in reply to Re^2: FIle transfer using sockets
in thread FIle transfer using sockets

You're right. I suggest something like this for client side:

print $sock "$file\0";
and something like this for server:
{ local $/ = "\0"; $file1 = <$conn>; chomp $file1; }

"\n" isn't portable. And at least on *nix file name may contain "\n"

Replies are listed 'Best First'.
Re^4: FIle transfer using sockets
by ig (Vicar) on May 10, 2009 at 09:45 UTC

    You might find Internet Line Terminators interesting. Not that what you recommend wouldn't work, but there might be some value in being consistent with many of the existing protocols.