PHP: Network problem; can't read files on the other computer

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
lac
Forum Newbie
Posts: 2
Joined: Wed Sep 21, 2005 5:36 pm

PHP: Network problem; can't read files on the other computer

Post by lac »

Hi everybody!

The are two PC's connected with a switch:
- 1. win2000 server
- 2. win98

I've installed PHP on the win2000 and I want to
read a file witch is on the win98 PC's harddisk.
For example: check the size of a file.

I've tried these codes:

<?php
$filename = '///COMPUTER_WIN98/data//text.txt';
echo filesize($filename);
?>

it echoes nothing, and if I map "data" directory of
the win98 machine, for example for "q:\", neither:

<?php
$filename = 'q:/text.txt';
echo filesize($filename);
?>

What is the sollution? Please, someone help!! :roll:

thx.
L.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

from what I remember, filesize cannot perform a stat() over a network. It would have to download the file to the machine to find the length of it.. not very efficient. You may be able to use strlen() and file_get_contents() .. but this will actually load the file into memory briefly..
lac
Forum Newbie
Posts: 2
Joined: Wed Sep 21, 2005 5:36 pm

Post by lac »

feyd wrote:from what I remember, filesize cannot perform a stat() over a network. It would have to download the file to the machine to find the length of it.. not very efficient. You may be able to use strlen() and file_get_contents() .. but this will actually load the file into memory briefly..
The filesize thing is just a test.
I have to read a .dbf file with the dbase functions of PHP.
The file is on the win98 machine. I couldn't read it.

There is no way to read dbf files throught the network? :(

thx,
:.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there likely is, [un]fortunately, I don't code for windows networks ;)
Post Reply