Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Pure Perl df

    Okay, I'm at a loss and need help. A friend of mine is working with a
    Perl script. It has a system call to df in it, he would like to
    replace with something a little more portable.

    The script is used in a 32 server environment that I know has at least
    four operating systems: HP-UX, Solaris, Linux, and Windows. I believe
    df is pretty standard on all of those but Windows, though the options
    vary.

    So the questions: Is there a pure Perl way to handle a df-like call?
    Is there an equivalent program in the Windows world? Any other tips?

    I browsed the CPAN a bit, but wasn't too happy with the choices there,
    aside from the fact that any module installs would pretty much defeat
    the purpose here.

    Thanks for any help you can provide.

    James

    James Edward Gray II Guest

  2. Similar Questions and Discussions

    1. Get Terminal Width and Height, Pure Perl
      Okay, I have a terminal program I need to get the width and height for. I have a very good reason needing to do it with a base 5.8 Perl install, if...
    2. NameSpace for pure-perl TCP reassembly
      I have a set of modules I'd like to upload to CPAN, but I'm unsure what namespace to put them in. They turn tcpdump capture files into TCP...
    3. pure-perl access to mySQL
      Hi! Since mySQL 3.2x there have been a lot of changes. But one was the most significant to me: the new login process. This thing made Net::MySQL...
    4. Pure Perl PDF creation module.
      Are there any Perl modules for creating PDFs that are purely Perl and don't depend on any 3rd party libs? Thanks.
    5. Pure Perl SQL server
      Does anyone know of a pure Perl SQL server? I have noticed the rise of 'pure Perl' modules for things like XML parsing, and the pure Perl...
  3. #2

    Default RE: Pure Perl df

    > Okay, I'm at a loss and need help. A friend of mine is
    > working with a
    > Perl script. It has a system call to df in it, he would like to
    > replace with something a little more portable.
    Well, looking here at the source to df on OpenBSD:
    [url]http://www.openbsd.org/cgi-bin/cvsweb/src/bin/df/df.c?rev=1.37&content-t[/url]
    ype=text/x-cvsweb-markup

    it looks as though it uses getmntinfo() to get information about free
    space. This function call may be implemented in some perl module, or you
    could be brave and use syscall() to call it. I'll work on that for kicks
    and get back to the list. Your friend will have to see if this function
    exists on all his unix platforms.
    > The script is used in a 32 server environment that I know has
    > at least
    > four operating systems: HP-UX, Solaris, Linux, and Windows.
    > I believe
    > df is pretty standard on all of those but Windows, though the options
    > vary.
    On Windows, I'd use Win32::DriveInfo
    > So the questions: Is there a pure Perl way to handle a
    > df-like call?
    > Is there an equivalent program in the Windows world? Any other tips?
    >
    > I browsed the CPAN a bit, but wasn't too happy with the
    > choices there,
    > aside from the fact that any module installs would pretty much defeat
    > the purpose here.
    Why is that? That is the point of modules.

    Luke
    Luke Bakken Guest

  4. #3

    Default RE: Pure Perl df

    >> I browsed the CPAN a bit, but wasn't too happy with the
    >> aside from the fact that any module installs would pretty much defeat
    >> the purpose here.
    >
    >Why is that? That is the point of modules.
    Note that if the module is pure perl without a lot of dependencies, you can
    ship it with your final tarbull - that's the approach I use with AmphetaDesk
    ([url]http://www.disobey.com/amphetadesk/[/url]), where I ship XML::Simple and
    Text::Template, even for Linux distributions. Stuff that requires
    compilation (like XML::Parser, Compress::Zlib, etc., etc.), I leave
    up to the ever easy-to-use CPAN.


    --
    Morbus Iff ( i put the demon back in codemonkey )
    Culture: [url]http://www.disobey.com/[/url] and [url]http://www.gamegrene.com/[/url]
    Spidering Hacks: [url]http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom[/url]
    icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

    Morbus Iff Guest

  5. #4

    Default Re: Pure Perl df

    On Dec 30, 2003, at 3:56 PM, Bakken, Luke wrote:
    >> I browsed the CPAN a bit, but wasn't too happy with the
    >> choices there,
    >> aside from the fact that any module installs would pretty much defeat
    >> the purpose here.
    >
    > Why is that? That is the point of modules.
    Well, as I said we're talking about 32 servers running at least 4
    different operating systems here, and we're not comparing versions yet.
    How many versions of Perl do you think that adds up to? If we're
    going to install modules under those conditions why not just check the
    OS version and shell out? I bet there are less combinations that way.

    This a professional server environment, with real world serving
    concerns like big uptime, system restores, etc. The way the sys admins
    keep on top of all that is to stay as in control of those machines as
    humanly possible. That means they think long and hard before adding
    more software dependancies. If they add even one module, that means
    they've practically doubled the work of all future Perl upgrades (one
    install to two, plus testing). If they add 10 modules across 32
    servers, well that's getting crazy pretty fast.

    Don't get me wrong. I love the CPAN and the tons of modules it offers.
    I'm sure they do too, under the right circumstance. They've got a job
    to do though and sometimes that makes for hard choices.

    James

    James Edward Gray II Guest

  6. #5

    Default RE: Pure Perl df

    > >> I browsed the CPAN a bit, but wasn't too happy with the
    > >> choices there,
    > >> aside from the fact that any module installs would pretty
    > much defeat
    > >> the purpose here.
    > >
    > > Why is that? That is the point of modules.
    >
    > Well, as I said we're talking about 32 servers running at least 4
    > different operating systems here, and we're not comparing
    > versions yet.
    > How many versions of Perl do you think that adds up to? If we're
    > going to install modules under those conditions why not just
    > check the
    > OS version and shell out? I bet there are less combinations that way.
    That's your answer. Use $^O and other OS indicators and set up df's args
    appropriately then.
    Luke Bakken Guest

  7. #6

    Default Re: Pure Perl df

    On Dec 30, 2003, at 4:07 PM, Morbus Iff wrote:
    > Note that if the module is pure perl without a lot of dependencies,
    > you can
    > ship it with your final tarbull
    I looked at three modules. Two didn't support Windows and I have no
    idea about the third, which I couldn't figure out what it was up to.
    If you guys are seeing a good module I'm missing please do point it
    out. Heck, if it's "pure Perl", I can just see how it's managing a df
    call...

    James

    James Edward Gray II Guest

  8. #7

    Default Re: Pure Perl df

    On Dec 30, 2003, at 4:30 PM, Bakken, Luke wrote:
    > That's your answer. Use $^O and other OS indicators and set up df's
    > args
    > appropriately then.
    Which gets us back to my other question: Is there a Windows equivalent?

    James

    James Edward Gray II Guest

  9. #8

    Default RE: Pure Perl df

    > > That's your answer. Use $^O and other OS indicators and set up df's
    > > args
    > > appropriately then.
    >
    > Which gets us back to my other question: Is there a Windows
    > equivalent?
    Sure, look at the output of the 'dir' command.
    Luke Bakken Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139