remote disk space ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • O.Gir

    remote disk space ...

    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)

  • Daniel Tryba

    #2
    Re: remote disk space ...

    O.Gir <olivier@nospam .posteasy.org> wrote:[color=blue]
    > 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)[/color]

    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.FileS ysytemObject), IIRC it can do the equivalent of df.

    --

    Daniel Tryba

    Comment

    • O.Gir

      #3
      Re: remote disk space ...

      Daniel Tryba a dit:[color=blue]
      > O.Gir <olivier@nospam .posteasy.org> wrote:
      >[color=green]
      >>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)[/color]
      >
      >
      > 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.FileS ysytemObject), IIRC it can do the equivalent of df.
      >[/color]

      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_e xec('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.

      Comment

      • Daniel Tryba

        #4
        Re: remote disk space ...

        O.Gir <olivier@nospam .posteasy.org> wrote:[color=blue]
        > exec('dir \\server\share' ,$tbdir,$retdir );
        > or :
        > $fspace=shell_e xec('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 ...[/color]

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

        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

        Comment

        • O.Gir

          #5
          Re: remote disk space ...

          Daniel Tryba a dit:
          [color=blue]
          >
          > That's propably because the user PHP is running under hasn't got the
          > rights to browse the shares?
          >
          >[color=green]
          >>I'll have a close look @ the scripting ref's you gave, but I'd really
          >>like to solve this problem strictly with php ...[/color]
          >
          >
          > 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.
          >[/color]

          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

          Comment

          Working...