Subject: | bug in dircopy |
My code:
dircopy("/tmp", "/tmp1");
e.g. my system username mit
e.g. sasldb2.db is located in the directory /tmp
-rw-r----- 1 cyrus mail 16384 21 may 19:08 sasldb2.db
With an attempt at copyings of file by another user, function dircopy
ceases its work; however, in the directory /tmp there are is still is
somewhat file and directories which must be copied.
Solution
Replace code in line 195-195:
if (defined $buf) { fcopy($org,$new,$buf) or next; }
else { fcopy($org,$new) or next; }
instead
fcopy($org,$new,$buf) or return if defined $buf;
fcopy($org,$new) or return if !defined $buf;
Thanks