By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,748 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,748 IT Pros & Developers. It's quick & easy.

remote disk space ...

P: n/a
Hi all,

can't manage to do it ..... was so easy under solaris ....
anybody knows how to get free disk space on remote disks ???

(with both local and remote *$#@%&* machines running *$#@%&* W$2000)

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
O.Gir <ol*****@nospam.posteasy.org> wrote:
can't manage to do it ..... was so easy under solaris ....
anybody knows how to get free disk space on remote disks ???

(with both local and remote *$#@%?&* machines running *$#@%?&* W$2000)


What is a remote disk (FS?, is it mounted?)?

BTW my guess is that you did it on Solaris using a "shell", if that's
the case you should take a look at microsofts scripting thingys
(http://msdn.microsoft.com/scripting (IIRC) and do a search for the
Scripting.FileSysytemObject), IIRC it can do the equivalent of df.

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
Daniel Tryba a dit:
O.Gir <ol*****@nospam.posteasy.org> wrote:
can't manage to do it ..... was so easy under solaris ....
anybody knows how to get free disk space on remote disks ???

(with both local and remote *$#@%?&* machines running *$#@%?&* W$2000)

What is a remote disk (FS?, is it mounted?)?

BTW my guess is that you did it on Solaris using a "shell", if that's
the case you should take a look at microsofts scripting thingys
(http://msdn.microsoft.com/scripting (IIRC) and do a search for the
Scripting.FileSysytemObject), IIRC it can do the equivalent of df.


Hi,

mmmmm .... year, of course, but the goal is to do it with PHP, and to do
it *quick* (ie: no recursive scanning)

Btw, you're (close to) right, while running solaris, I did a popen('df
<filesystem>','r'), and then parsed the output of a fgets() ...
<filesystem> being a nfs mounted FS ressource identifier ... that worked
great ...

I guess that parsing the last line of the output of a simple "dir"
command should do the job, but even if I can type "dir \\server\share"
inside a console, and obtain the result I want, doing it by this way:

exec('dir \\server\share' ,$tbdir,$retdir);
or :
$fspace=shell_exec('dir \\server\share');
or even:
$fspace=system('dir \\server\share');

(... yes, I escaped the string before sending it ...)

.... works on local filesystems, but not on remote ones ...

.... drives me crazy ...

I'll have a close look @ the scripting ref's you gave, but I'd really
like to solve this problem strictly with php ...

Thx anyway - O.Gir.

Jul 17 '05 #3

P: n/a
O.Gir <ol*****@nospam.posteasy.org> wrote:
exec('dir \\server\share' ,$tbdir,$retdir);
or :
$fspace=shell_exec('dir \\server\share');
or even:
$fspace=system('dir \\server\share');

(... yes, I escaped the string before sending it ...)

... works on local filesystems, but not on remote ones ...

... drives me crazy ...
That's propably because the user PHP is running under hasn't got the
rights to browse the shares?
I'll have a close look @ the scripting ref's you gave, but I'd really
like to solve this problem strictly with php ...


So you call use of df/dir strictly PHP! I find that extremly amusing.
You are trying do host specific stuff you can't (AFAIK) do in strictly
PHP.

BTW the links I suggested are to be used with the PHP COM extensions.

--

Daniel Tryba

Jul 17 '05 #4

P: n/a
Daniel Tryba a dit:

That's propably because the user PHP is running under hasn't got the
rights to browse the shares?

I'll have a close look @ the scripting ref's you gave, but I'd really
like to solve this problem strictly with php ...

So you call use of df/dir strictly PHP! I find that extremly amusing.
You are trying do host specific stuff you can't (AFAIK) do in strictly
PHP.

BTW the links I suggested are to be used with the PHP COM extensions.


No Daniel, I can swear you the user running apache/php has full read
access to these locations (..... verification .....) yes, it has ...

Yes, it's rather chimeric to try to access low level ressources of
remote disks, that's why I'm on to use system commands while I hate
doing it. But I found some interresting stuff under the link you
previously suggested (excuse me not have the reflex of msdn searching,
this universe is rather new for me ;) ), and I'm quite confident .....

O.Gir

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.