You are here: Re: [PHP] fopen on windows « PHP « IT news, forums, messages
Re: [PHP] fopen on windows

Posted by "Richard Lynch" on 11/14/05 22:59

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.

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

4096 is longer than any line in the file?

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

> Am I missing something other than an ice cold beer?

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.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация