Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: CGI-Attachment with many \0's

by stefan k (Curate)
on May 10, 2004 at 11:13 UTC ( #352018=note: print w/ replies, xml ) Need Help??


in reply to Re: CGI-Attachment with many \0's
in thread CGI-Attachment with many \0's

hi,
yes, they are. Actually, the script first generates the files (using File::Temp::tempfile as a name generator) and then tries to pack them all together.

Regards... Stefan
you begin bashing the string with a +42 regexp of confusion


Comment on Re: Re: CGI-Attachment with many \0's
Re: Re: Re: CGI-Attachment with many \0's
by eXile (Priest) on May 11, 2004 at 00:08 UTC
    mmm, at what point do you actually check if these files are there?

    What I'd do, because it is a strange problem, is use perl -d to step through your code on the box where the problem appears, maybe set a breakpoint just before the archive is created and at that point check if the files are there and what their size is (or add print/system commands in your source code to debug, depending on your debugging style).

    Another thing that might be going wrong when your script generates the files is that the file-content still is in the output buffer instead of on disk. You can set $|=1 to avoid this.

      Hi,
      first of thanks for staying with me for so long!

      Usually print is my debugger ;-) But in this case it makes little sense, since I know that the archive is created: it can be written to the local disk just fine.

      The problem only arises when the archive is delivered via Webserver, and even then only on one of two almost identical machines. Funny business, that is.

      Regards... Stefan
      you begin bashing the string with a +42 regexp of confusion

        Have you tried the $|=1?

        I suspect this has got something todo with the timing of events (are these 2 machines different hardware or do they have a different workload?). The webserver delivery might be done at a time where the archiving/tempfile-creation is not totally finished. I don't know your code and modules you are using, so this is only a guess.

        In that case you might also try, as a debugging tool, to add some 'sleep'-commands inbetween the tempfile-creation/archive-creation and delivery via the webserver, and see if that changes the behaviour.

        Maybe you could also post the relevant piece of your code, fresh eyes can help a lot.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://352018]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-07-25 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls