what is rc=65535?
I have a system call
my $rc=system("cp $a") where $a is a string like file1 file2
This works in the vast majority of times
but sometimes returns a nonzero rc, in this case rc=65535.
65535 = -1 in a 16 bit integer.
I would suggest that the "cp" is returning an error code of -1.
The "man" page for "cp" suggests that a non-zero return code warns of failure.
Right, but what exactly is failing? There's plenty of disk space the disks are brand new. Plus after a few times
the code runs with no such failures. In the net I found
that this code is associated with SCSI disks and old M/Bs for kernel versions prior to 2.3(I have 2.6.13)-this is Linux Slack 10.2 btw
Could be lots of things.
Permissions for example?
Your code does "cp $a" and $a might not contain what you think it does.
Why not add a line that says:
Do you have a sort() operation earlier in your program? Aren't $a and $b reserved for sort() operations? Might be changing in that sort, if there is one...
Here are more detailed diagnostics:
It looks like the reason was: cannot alocate memory(for a system call like cp??!!)!!
top did not complain about memory. I suspect the problem is
much more serious(after storing and deleting large
datastructures which is what the program does, I simply cannot believe it
lacks the memory for a cp!). It does not happen on other machines with less memory even(I have 2GB RAM here)
copy /home/myuser/AFILES/s7ermsc1.0.2.gz to /home/myuser/DFILES/s7ermsc1.0.2.av.gz from AFILES to DFILES failed with 65535.
Exclam point is Cannot allocate memory
child exited with value %d
not copied ( cp /home/myuser/AFILES/s7ermsc1.0.2.av.gz /home/myuser/DFILES/s7ermsc1.0.2.av.gz )
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.