Reading data from an unknown file

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
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Reading data from an unknown file

Post by mikebr »

I guess this is the right place for this.

I want to extract some information contained in a file but I can't seem to read the contents. I have tried using a text editor 'Mac BBEdit' which can open most files and databases but BBEdit shows no contents. I also ran fopen($file,"r") on it to try and read it but nothing. The file is 1.7mb in size and has no dot notation.

Anyone any ideas of what best options I would have on how I might do this?

Thanks
Last edited by mikebr on Tue Jun 14, 2005 7:14 am, edited 3 times in total.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

- Do you have sufficient rights to read the file?
- On a *nix machine there is a program "file" which can tell you what the file contains (Well, it's pretty good at estimating anyway)
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Post by mikebr »

I am working on a Mac 'Unix base' and in the permissions info I own the file and have read write access.

Don't know much about unix but I tried reading the file from a 'OSX' terminal window using 'sudo /Users/mb/Desktop/sp_database', got nothing there either.

Thanks
mikebr
Forum Contributor
Posts: 243
Joined: Sat Sep 28, 2002 7:05 am

Post by mikebr »

Sorry I meant 'pico /Users/mb/Desktop/sp_database'.
Post Reply