Re: file_get_contents
| From: | Robert Cummings | Date: | Thu, 07 Jun 2007 20:01:55 +0000 |
| Subject: | Re: file_get_contents | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256314@lists.php.net to get a copy of this message | ||
On Thu, 2007-06-07 at 15:39 -0400, Chris Boget wrote:
> Does file_get_contents() not work with absolute paths? I'm able to
> successfully write data to a file that I create dynamically but when I go
> back to actually read the contents of the file, nothing seems to work. Not
> file_get_contents(), not file(), not fread() and not fgets();
>
> $mydata = 'joebobbriggs';
> $filename = 'c:\\temp\\my_file_name.txt';
> $resource = fopen( $filename, 'w+' );
> fwrite( $resource, $mydata );
> fclose( $resource );
>
> echo 'File data: ' . file_get_contents( $filename );
>
> Nothing gets displayed but I see that the file was created and that it has
> the data I defined.
>
> What's going on?
That's the strangest absolute path I've ever seen... it seems to have
some kind of non-absolute prefix.
This has been a troll >:)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'