Re: Writing files on Linux

From: Date: Fri, 10 Aug 2001 20:31:03 +0000
Subject: Re: Writing files on Linux
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62215@lists.php.net to get a copy of this message
What error does it give you? Is it a permissions issue? - Dan On Fri, 10 Aug 2001, Corin Rathbone wrote: > Does anybody know why the function below does not work on Linux yet works > perfectly well on windows. > > function write_file($file, $contents){ // $contents is like "Test, Test" > global $root_path; // $root_path is /var/www/htdocs > $file_location = $root_path.$file; // $file is /jim.txt > $fp = fopen("$file_location", "w") or die("Could not open file > pointer."); > $worked = fwrite($fp, $contents) or die("Could not write to file pinter"); > // It fails here > fclose($fp) or die("Could not close file pointer"); > return $worked; > } > > It always fails at fwrite. > > Thanks, > Corin Rathbone > > > --

« previous php.general (#62215) next »