Re: Module file writing problem



webmaster@xxxxxxxxxxxxxxxxxxx wrote:
At first the line looked like "open (FILE,'file.dat');"

You're making a bad assumption there. You cannot rely on relative path names to files like that if you have not yourself executed a chdir() to change the default working directory. The current working directory is not specified in the CGI standard.

but then I changed it to "open (FILE,'/user/file.dat');"....

I would not expect that to ever work. You need to use the actual absolute pathname. Simply chopping off 'cgi-bin' to convert cgi-bin/some/name' to '/some/name' is not the way to get the actual name. -Joe .



Relevant Pages

  • Re: giving path to a program file from the process
    ... can I exec that program from currently running ... In general, NO, you don't have to chdir to it. ... they are relative to *its* current working directory, ... The various forms of exec*do not take a single string with a ...
    (comp.unix.programmer)
  • circular references, chdir() and Term::ReadLine::Gnu?
    ... it's an extremely complicated project. ... would cause objects not to destroy properly? ... code without the chdir() things are cleaned up, ... Ever been burned by current working directory during the DESTROY process? ...
    (comp.lang.perl.misc)
  • Re: Problem with one perl script executing another, execution started by Apache httpd
    ... Only works if myscript.pl is in the current working directory. ... Make sure that you either do chdir or give the full path to your ... script. ... Charles DeRykus ...
    (comp.lang.perl.misc)
  • Re: no chdir() in mach-o build of CW9?!?
    ... there seems to be no chdir() function!!! ... defined and implemented in classic and carbon libraries, ... a way to change the current working directory with some CF ... to include the appropriate header file? ...
    (comp.sys.mac.programmer.codewarrior)
  • Re: Changing Directories
    ... > I can use the chdir() function to change the working directory. ... > the comparable method in Java? ...
    (comp.lang.java.help)