I have a script that copies files over a socket. In the perl 4 version, it
used read() and syswrite(). In perl 5, if I use read(), I wind up causing a
connection problem later on (dunno why, but it's too difficult to explain here
and not germane to the question I come to you with). So I switched to sysread.
Now, the script spontaneously (but consistently) dies inside of syswrite.
Usually by the 5th or 6th packet from sysread(). I have debug markers
bracketing the syswrite, so I know that's where it's at. Here's the cute part:
Normal operation (where it dies consistently) is to write the data to a pipe
opened on the uncompress command (possibly further piped to tar xf)
"Transfer-only" mode instead writes it straight to a file on disk. This mode
works, exact same loop, with no errors or unexpected death. Only difference is
that the write-to filehandle is a file rather than a write-only pipe.
I'm stumped, I'm going to work on something else for a while. Like needlepoint,
maybe.
Randy
--
^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS Phone: (303)607-5268
Denver, CO rjray@lookout.ecte.uswc.uswest.com
I don't suffer from insanity. I enjoy every minute of it.
used read() and syswrite(). In perl 5, if I use read(), I wind up causing a
connection problem later on (dunno why, but it's too difficult to explain here
and not germane to the question I come to you with). So I switched to sysread.
Now, the script spontaneously (but consistently) dies inside of syswrite.
Usually by the 5th or 6th packet from sysread(). I have debug markers
bracketing the syswrite, so I know that's where it's at. Here's the cute part:
Normal operation (where it dies consistently) is to write the data to a pipe
opened on the uncompress command (possibly further piped to tar xf)
"Transfer-only" mode instead writes it straight to a file on disk. This mode
works, exact same loop, with no errors or unexpected death. Only difference is
that the write-to filehandle is a file rather than a write-only pipe.
I'm stumped, I'm going to work on something else for a while. Like needlepoint,
maybe.
Randy
--
^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS Phone: (303)607-5268
Denver, CO rjray@lookout.ecte.uswc.uswest.com
I don't suffer from insanity. I enjoy every minute of it.