Nevermind... Apparently I'm a total retard :p The coding error was in my calling $argv[0] thinking it'd be what I passed to my batch file, but infact it is the actual file being run. The argument I wanted was $argv[1]. This meant that nothing was being read, and so the script was attempting to write a null string, which apparently gives an erro :)
Thanks for the help anyway ;) chris kranz fatcuban.com -----Original Message----- From: Sven Schnitzke [mailto:[EMAIL PROTECTED] Sent: 26 February 2003 09:30 To: 'Chris Kranz' Subject: AW: [PHP-WIN] file write issues... Hi Chris, code runs fine on my config (PHP 4.4-dev, WIN98SE). Where do you expect the file to show up? It will be genereated in the folder of PHP.EXE when in CGI or CLI modes and in the webserver's folder in SAPI mode. -- Sven > -----Ursprüngliche Nachricht----- > Von: Chris Kranz [SMTP:[EMAIL PROTECTED] > Gesendet am: Dienstag, 25. Februar 2003 18:40 > An: 'PHP' > Betreff: [PHP-WIN] file write issues... > > running this script command line... > > $temp_file = "temp_file.txt"; > if( !file_exists( $temp_file ) ) > { > touch( $temp_file ) or die( "couldn't create new file" ); > } > $fp = fopen( $temp_file, "wb" ) or die( "file opening failed" ); > fwrite( $fp, $cvs ) or die( "write file failed" ); fclose( $fp ); > > doesn't write to file. the $cvs is there, nice little comma delimited > string waiting to be put into my file. if i run this off my web > server, it runs fine. but i need to run it command line, and it just > gives me the error "write file failes". dunno why. tried changing it > to fputs, and also added the touch line in there incase it was having > trouble creating the file... which it's not, coz the file gets created > fine. > > any help please? :) > > chris kranz > <http://www.fatcuban.com/> fatcuban.com > > > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php