I use psexec to run the Perl program on remote Windows computers. The program makes an xcopy system call. This works fine when executed directly (locally) on machines, but when remotely started via psexec, xcopy crashes with the following message:
Error creating file. Invalid function.
(Depending on the user, the message may instead be "Access denied.")
Note that $! gives the following diagnostics:
Bad file descriptor on syscall.pl. perl exited REMOTE with error code 9.
It doesn't seem to matter if xcopy is called via system () or backlinks.
I must indicate that the "from" folder is a dynamic view of ClearCase (M-drive).
Oddly enough, xcopy seems to work correctly when called directly from psexec.
Here are some other oddities:
xcopy does not always fail. Some files just seem “damned”. The read-only attribute does not appear to be a factor.
As soon as the copy completes successfully (for example, through Windows Explorer), the curse will be canceled, and this particular file will no longer cause xcopy errors.
The problem is not related to the destination folder. After the curse is canceled, the file can be transferred to a new destination.
The following is part of the Perl script test. I used to narrow down the problem (folder names were generalized). Please note that for each test "my $ cmd" I commented on the previous one and added a comment to the state.
# ClearCase directory M:\STUFF\ABC contains ABC.tst, ABC.zip and several nonempty subfolders
source share