saintex has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I would like to write some simple scipts using some calls to standard unix commands like du, df, uptime. And this is the question: is there away to do something analogous throught perl, for Windows System? Are there some CPAN modules or some Perl ports implementing these utilities?

Replies are listed 'Best First'.
Re: Like du, df, uptime
by planetscape (Chancellor) on Feb 27, 2010 at 18:14 UTC
      Thank you for your reply. Perl power tool are no more available at the link you send me: http://ppt.perl.org/ Where can I get them?

        Scroll a bit further down in the node to the bit labeled "Update: 2009-11-16 :". ;-)

        HTH,

        planetscape
Re: Like du, df, uptime
by BrowserUk (Patriarch) on Feb 27, 2010 at 18:26 UTC

    See UnxTools


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Like du, df, uptime
by CountZero (Bishop) on Feb 27, 2010 at 19:20 UTC
    Or install the "official" Services for Unix (this link takes you directly to the download for Services for Unix) provided by Microsoft!

    It is a big install, which includes the usual GNU compilers and the lot. It will even install ActiveState Perl for you if you let it.

    Update: Added a link to the inde xpage of SFU (Thanks ww!)

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Like du, df, uptime
by clp (Friar) on Feb 27, 2010 at 21:02 UTC
    Another choice is to install cygwin on a Windows system, to get a Linux-like environment, with bash, du, df, Perl, ssh, easy access to CPAN, & many other tools.

    Installation & configuration can be time-consuming, but you have much more than a Swiss Army knife: you have a good-sized, multiple-drawer toolbox filled with tools that you already know how to use (if you have a Linux background).

    I find Cygwin very useful for machines that I control. If your goal is to build Perl code that will run on various machines that are outside your control, installing Cygwin on them might be difficult or impossible.

    See these search results for other nodes on PerlMonks about cygwin, to get a feel for problems and solutions.

      So, for df I can use Perl buin-in utilities, like: http://www.perlmonks.org/?node_id=446142

      for du I can use cpan: http://search.cpan.org/~cwest/ppt-0.14/bin/du

      but I don't know exactly what I can use in order to have load average in a Windows System...

      Nix utilities for windows don't have an uptime tool with load average on 1,5, 15 minutes... but they have top command.

      Uptime for windows: http://download.microsoft.com/download/winntsrv40/install/uptime_1.01/nt4/en-us/uptime.exe it has only the time the system is up...

      Any idea to have load average on windows in unix-like environemt?

      thank you!

Re: Like du, df, uptime
by ambrus (Abbot) on Feb 27, 2010 at 18:31 UTC
Re: Like du, df, uptime
by toolic (Bishop) on Feb 27, 2010 at 20:12 UTC
    Are there some CPAN modules ... ?
    It's not too hard to find out: