Page 1 of 1

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

Posted: Wed Sep 21, 2005 5:51 pm
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.

Posted: Wed Sep 21, 2005 6:06 pm
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..

Posted: Wed Sep 21, 2005 6:13 pm
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,
:.

Posted: Wed Sep 21, 2005 6:41 pm
by feyd
there likely is, [un]fortunately, I don't code for windows networks ;)