in reply to download attempted vs completed

My quick shot is using syswrite.

syswrite FILEHANDLE,SCALAR ... Returns the number of bytes actually written, or "undef" if there was an error (in this case the errno variable $! is also set).

Counting the bytes send should go like this:
... while(<FILE2>){ $count += syswrite STDOUT, $_ } ...

Replies are listed 'Best First'.
Re^2: download attempted vs completed
by etzel42 (Initiate) on Mar 25, 2006 at 14:31 UTC

    syswrite seems to be the best answer, only I have never used this before. I have looked into it, but seems a bit complicated to use. Also if I got this working, how would I go about finding out how much a user has already downloaded on a partial download?

    It seems to me that if I could find out the partial download then it would work great. Otherwise I would not know what they have already downloaded and thus not be able to set the offset and would not be able to count the download when it finished, as I would not know it was finished.

    There must a way to just find out when a download completes. Using a eof like statement or something.