[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] CGI-created files aren't found



At 6:41 pm 4/4/96, Julia Marie Victoria Weatherby wrote:
>I have a cgi MacPerl program that appends to an existing file -or-
>if the file doesn't exist, it creates the file and adds to it.
>The program does this part okay.
>
>After the file is updated, I want the web-user to go right to the
>file, so I have   print "Location: http://somewhere/file.txt\n\n";
>When I use this method, it doesn't work! The (WebStar) server says
>that the file doesn't exist. I can only get to the file if I type
>in the URL again. (Hitting reload in Netscape isn't working for this.)

Just a speculation - could this be anything to do with the delay between
creating a file and it actually appearing in the Finder's directory
structures? For instance, if you create or delete a file and then
immediately crash your Macintosh, the file is often not there (or *is*
there, in the case of deletions) when you reboot. As I understand it, the
Finder holds off on performing updates until it has a moment of idle time,
and this can be anything up to about 30 seconds or possibly more. If
MacPerl makes the file, and then WebStar tries to access it before the
Finder has decided it's there, then that might explain why it can't be
found. That doesn't explain, however, why NetScape doesn't get it when you
do a reload, unless NetScape says "give me a directory that includes files
changed since T1", WebStar looks in the folder and says, "Nope, last file
there has a modification/creation date of T0, nothing new here.", even
though the file wasn't actually written to disc until T2.

Is this at all plausible, or do I need to get more sleep and cut down on
the substances?

                A