[bug #62561] "files0-from" expression prints "find: '\n' No such file or directory "

Bernhard Voelker <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Update of bug #62561 (project findutils):

                  Status:                    None => Working as Intended    
             Assigned to:                    None => berny                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Thanks for the report and the patch.

I'm afraid it's not a bug or something to fix or handle in find,
but rather a misunderstanding on your side how -files0-from
works.

The only valid entry separator in the input from -files0-from
is the NUL character.  This is intentional to allow arbitrary
input.

E.g. it is allowed and fully okay to have a file named '\n':

$ echo hello > '\n'

$ cat '\n'
hello

$ rm -v '\n'
removed '\n'


P.S. editors like vim usually handle text files, and POSIX
says that text files must end on a newline.
Therefore, it's not good to edit the binary input for -files0-from
with a text editor, because they change the end of the file:


$ printf '/home\0' > startpoint.txt

$ od -tx1z startpoint.txt
0000000 2f 68 6f 6d 65 00                                >/home.<
0000006

# Edit the file with a text editor and save it.
$ vi startpoint.txt

$ od -tx1z startpoint.txt
0000000 2f 68 6f 6d 65 00 0a                             >/home..<
0000007

See the trailing newline.

Therefore, I'm closing this as 'works as intended'.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62561>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.