Unable to read using file functions...[solved]

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

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Unable to read using file functions...[solved]

Post by raghavan20 »

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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

permissions issue?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

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..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

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.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

I am not able to get stat information for that text file...other files seem to be ok...look here
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

just noticed.. you are trying to reference sampleDoc.txt but you have sampeDoc.txt notice there's no L.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

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...
Post Reply