Loading ...
Sorry, an error occurred while loading the content.

Close files upon script termination?

Expand Messages
  • Tim Pushor
    Hi All, In my current application, I have one page in particular that must be syncronized with an external process, and I am using an flock ed file to provide
    Message 1 of 3 , Jun 23, 2003
    • 0 Attachment
      Hi All,

      In my current application, I have one page in particular that must be
      syncronized with an external process, and I am using an flock'ed file to
      provide a mutex of sorts. The problem is that I cancelled a long running
      operation (where the file was locked) and it seems that the file does
      not automatically get closed.

      Is there an easy way to ensure that the file will get closed even if the
      user presses the 'stop' button? I am hoping that there is something
      simple that I can do rather than a global handler that within I must
      determine if there is a lockfile open.

      Thanks,
      Tim



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... Try after opening the file... $Server- RegisterCleanup(sub { close(FILE) }); Regards, Josh ________________________________________________________________
      Message 2 of 3 , Jun 23, 2003
      • 0 Attachment
        Tim Pushor wrote:
        > Hi All,
        >
        > In my current application, I have one page in particular that must be
        > syncronized with an external process, and I am using an flock'ed file to
        > provide a mutex of sorts. The problem is that I cancelled a long running
        > operation (where the file was locked) and it seems that the file does
        > not automatically get closed.
        >
        > Is there an easy way to ensure that the file will get closed even if the
        > user presses the 'stop' button? I am hoping that there is something
        > simple that I can do rather than a global handler that within I must
        > determine if there is a lockfile open.
        >
        > Thanks,
        > Tim
        >

        Try after opening the file...

        $Server->RegisterCleanup(sub { close(FILE) });

        Regards,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • marco sottana
        i would like to have an installer for asp for apache .. ... From: Josh Chamas To: Tim Pushor Cc:
        Message 3 of 3 , Jun 24, 2003
        • 0 Attachment
          i would like to have an installer for asp for apache ..


          ----- Original Message -----
          From: "Josh Chamas" <josh@...>
          To: "Tim Pushor" <timp@...>
          Cc: <asp@...>
          Sent: Tuesday, June 24, 2003 7:15 AM
          Subject: Re: Close files upon script termination?


          > Tim Pushor wrote:
          > > Hi All,
          > >
          > > In my current application, I have one page in particular that must be
          > > syncronized with an external process, and I am using an flock'ed file to
          > > provide a mutex of sorts. The problem is that I cancelled a long running
          > > operation (where the file was locked) and it seems that the file does
          > > not automatically get closed.
          > >
          > > Is there an easy way to ensure that the file will get closed even if the
          > > user presses the 'stop' button? I am hoping that there is something
          > > simple that I can do rather than a global handler that within I must
          > > determine if there is a lockfile open.
          > >
          > > Thanks,
          > > Tim
          > >
          >
          > Try after opening the file...
          >
          > $Server->RegisterCleanup(sub { close(FILE) });
          >
          > Regards,
          >
          > Josh
          > ________________________________________________________________
          > Josh Chamas, Founder phone:925-552-0128
          > Chamas Enterprises Inc. http://www.chamas.com
          > NodeWorks Link Checking http://www.nodeworks.com
          >
          >
          > ---------------------------------------------------------------------
          > To unsubscribe, e-mail: asp-unsubscribe@...
          > For additional commands, e-mail: asp-help@...
          >


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.