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

Re: [PBML] strange problem creating /opening file..

Expand Messages
  • Charles K. Clarkson
    ... No, (well sort of). According to the manual (perlfunc open ): If MODE is , the file is opened for appending, again being created if necessary. You
    Message 1 of 1 , Jul 1 12:10 PM
    • 0 Attachment
      Franki <frankieh@...> wrote:

      : Hi all,
      :
      :
      : I have a script that creates a unique file for each person
      : that use it.. and the file is used to track their
      : progress...
      :
      : for some reason, it works on Linux/unix servers, but not
      : on the NT/2000 test server with IIS5 and activeperl...
      :
      : here is the line in question..
      :
      : open (CART, "+>>$sc_cart_path") ||
      : &file_open_error("$sc_cart_path", "Add to Cart",
      : __FILE__, __LINE__);
      :
      : now $sc_cart_path is basically the explicit path to the
      : directory, with the new unique file name tacked onto
      : the end..
      :
      : doesn't +>> mean that open the file and append to it if
      : possible, or if file doesn't exist create it??

      No, (well sort of). According to the manual
      (perlfunc 'open'):

      'If MODE is '>>', the file is opened for appending,
      again being created if necessary. You can put a
      '+' in front of the '>' or '<' to indicate that
      you want both read and write access'

      If '+>>' isn't working thy separating reads and
      writes. Open the file for reading, close it, open it
      for appending, close it, repeat as necesary. Using
      '+>>' is supposed to work, but doesn't always.

      :
      : it doesn't work though,, I get an error message stating:
      : FILE OPEN
      :
      ERROR-Inetpub/Scripts/cgi-bin-2000/scripts/gshop/shopping_carts/8679809.1548
      : |FILE=C:\Inetpub\Scripts\cgi-bin-2000\scripts\gshop\gshop.cgi|LINE=637
      :
      : even if I manually create the file, the script won't write
      : to it... and still reports the error.
      :
      : I have many other instances in this script that write to
      : existing files, and they do that just fine, but this is
      : the only one that creates a file each time it runs..
      :
      : the file name is usually something like: 8679809.1548
      : with is long and obtuse to make sure it is unique...
      :
      :
      : does anyone know what I am doing wrong ? its driving me
      : nuts.. I have been staring at the script for hours to
      : now avail...
      :
    Your message has been successfully submitted and would be delivered to recipients shortly.