Re: fopen on windows

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

 



Jay Blanchard wrote:
$theFile = fopen("docs/InstallationInstructionMaster.txt", "r") || die;

I'm not sure if it would make any difference, but I usually use "or" in this case rather than "||", and I know they have different operator precedence.

while(!feof($theFile)){
	$theLine = fgets($theFile, 4096);
	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;
[snip] Am I missing something other than an ice cold beer?

Well, it's a pretty model example of a line-by-line file read. I can't see anything wrong with it, so perhaps the problem lies elsewhere. There's no other files with the same name in your include_path?

Maybe something to do with auto_detect_line_endings or whatever it's called, in php.ini? (I know, probably a long shot.)

--
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