PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Tue Feb 07, 2006 5:42 pm
I am unable to read a text file in the same directory. Look at this
file at work
Code: Select all
<pre>
<?php
var_export(glob("*.*"));
var_export(file ("sampleDoc.txt"));
$fileString = file_get_contents("http://assorted.100webcustomers.com/sampleDoc.txt");
var_export($fileString);
?>
</pre>
Last edited by
raghavan20 on Tue Feb 07, 2006 6:54 pm, edited 1 time in total.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 07, 2006 5:45 pm
permissions issue?
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Tue Feb 07, 2006 5:55 pm
This is the usual host which I have been using for a long time. I do not have a clue why it is not working? any guesses..
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 07, 2006 6:01 pm
As I said, permissions issue?
check the permissions of the files in relation to PHP's.
getmyuid()
getmygid()
getmyinode()
stat()
Have you talked to the host? Maybe they changed something.
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Tue Feb 07, 2006 6:09 pm
I am not able to get stat information for that text file...other files seem to be ok...look
here
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 07, 2006 6:13 pm
just noticed.. you are trying to reference sampleDoc.txt but you have sampeDoc.txt notice there's no L.
raghavan20
DevNet Resident
Posts: 1451 Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:
Post
by raghavan20 » Tue Feb 07, 2006 6:15 pm
what a fool am I...anyway, you let me know some good Unix related commands...thanks to you...often, I have noticed that programmers spend more time on small errors which are hard to notice...