[patch] /bin/cp POSIX conformance

Jason Smethers jason at smethers.net
Mon Dec 20 10:09:17 PST 2004


For the cp utility, IEEE Std 1003.1-2004 states the following under 
section 2d:

2. If source_file is of type directory, the following steps shall be taken:

. ..

   d. If dest_file exists and it is not of type directory, cp shall 
write a diagnostic message to standard error, do nothing more with 
source_file or any files below source_file in the file hierarchy, and go 
on to any remaining files.



Currently, the cp utility exits with the diagnostic message. The patch 
below turns this into a warning, and also changes another warning to use 
the standard errno EISDIR.

- Jason

<http://www.smethers.net/~jason/patches/cp.c.diff1>





More information about the Submit mailing list