RE: fopen on windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
On Fri, November 11, 2005 2:51 pm, Jay Blanchard wrote:
> $theFile = fopen("docs/InstallationInstructionMaster.txt", "r") ||
> die;

Don't use || when you mean 'or' :-)

Nor sure it really matters here, but better to follow the crowd and
use 'or' here.
[/snip]

Okie dokie. Found there to be no change in behavior at this point. Perhaps I
need to set the error checking higher, say E_ALL.

[snip]
> while(!feof($theFile)){
> 	$theLine = fgets($theFile, 4096);

4096 is longer than any line in the file?
[/snip]

Yes, it accounts for every line in the file.

[snip]
> 	echo $theLine . "<br>\n";
> }
> fclose($theFile);
>
> The above code appears to work, but all that is output is lines of
> line
> breaks....no data. The file is a tab delimited test file;

View Source?
[/snip]


Looks like;

<br>
<br>
<br>
<br>
<br>
....

[snip]
Are you 100% certain you don't have an empty file in
docs/InstallationInstructionMaster.txt sitting right next to your
script, while the REAL file you want is somewhere else?

Been there.  Done that.  Smacked the forehead.

Use the full path to the file to be SURE you are reading the file you
think you are reading.
[/snip]

Did that too. Still no joy.

Several other methods have been provided and I will use one of those.
However, when I get to the point that fopen would be my only choice I will
likely encounter these same problems. C'est la vie!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux