Subject: | fcopy to dir causes chmod on dir, not on file |
If the second argument to fcopy() is a directory, then the source file's
mode is mistakenly applied to the destination directory, not to the
destination file. In detail:
% touch file
% mkdir dir
% ls -ld file dir
drwxr-xr-x 2 chris wheel 68 Apr 11 14:47 dir
-rw-r--r-- 1 chris wheel 0 Apr 11 14:47 file
% perl -le'use File::Copy::Recursive "fcopy";fcopy "file","dir"'
% ls -ld file dir
drw-r--r-- 3 chris wheel 102 Apr 11 14:47 dir
-rw-r--r-- 1 chris wheel 0 Apr 11 14:47 file
The error is that after fcopy, the dir has lost its execute bits due to
a misapplied chmod.
Chris