[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

From: Bernhard Voelker
Subject: [bug #62561] "files0-from" expression prints "find: '\n' No such file or directory "
Date: Thu, 2 Jun 2022 13:13:28 -0400 (EDT)

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

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

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

$ echo hello > '\n'

$ cat '\n'

$ 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.<

# 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..<

See the trailing newline.

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


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]