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

Re: [PBML] opening a file in NT?

Expand Messages
  • Tom Barron
    ... Inability to create an output file usually means that you don t have permission to write to the directory where you re trying to create it. You can verify
    Message 1 of 1 , May 20, 2000
      > Sujit Kirpekar wrote:
      >
      > I am trying to run this on an NT server .. and I get an error :
      > callhttp(): cannot create output file.
      >
      > What' wrong? I am relatively new to NT .. so how do I go about
      > creating text files, etc?
      >
      > Sujit
      >
      > #usr/bin/perl
      >
      > use LWP::Simple;
      >
      > $msg = &CallHTTP("www.whatever.com/something.html?D1=$D1","data.txt");
      > .............
      > .............
      > ..........
      >
      > sub CallHTTP{
      > my($host,$file)=@_; my($path,$out,$fout);
      > $path="http://" . $host;
      > $out = get($path);
      > if($file){
      > open(FILE,">$file")||return("callhttp(): cannot create output
      > file");
      > print FILE "$out\n";
      > close(FILE);
      > } else{
      > return $out;
      > }
      > return 0;
      > }


      Inability to create an output file usually means that you don't have
      permission to write to the directory where you're trying to create it.
      You can verify this by adding "$!" to the error message the script
      produces:

      open(FILE,">$file")||return("callhttp(): cannot create output file:
      $!");

      This is display the system error that caused the problem.

      Tom
    Your message has been successfully submitted and would be delivered to recipients shortly.