Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Umm... (Score:3, Informative)

    Another issue - Ruby's Etc module doesn't support the 'set' side of the house (setgrent, sethostent, etc). But I really have to wonder how often anyone uses these functions anyway. I have *never* seen them used anywhere, and I suspect most admins would rather perform their functionality manually rather than programatically. That being said, they *could* be supported on Win32 as well.

    I have this nagging feeling that you have misunderstood the "'set' side"... it has nothing to do with setting entries.

    • Re:Umm... (Score:3, Informative)

      Oh, you're right. That's what I get for not reading the docs. :-P

      Okay, now that I've actually looked at the docs for sethostent and setgrent....they're just like setprotoent which I *do* remember now.

      My guess was that they're some holdover from 20 years ago when holding a pointer in the middle of a file was an attempt to gain speed/efficiency while reading the file. Given the size of the files being read from (usually around 10-100k), I cannot fathom what use they are nowadays, or for the last 10 year

      • Re:Umm... (Score:3, Interesting)

        Regardless of their origin, you will have to implement them if you want to support them :-) Yes, for modern PC implementations you will probably want to suck in the whatever database to memory and then iterate over that on your own. Remember, however, that PCs with gigabytes of memory are not all the systems out there.
        • by djberg96 (2603) on 2003.09.04 14:56 (#23863) Journal
          Um, what? Who has gigabytes worth of /etc/passwd or /etc/group entries?

          Anyway, unless someone can demonstrate some critical piece of code (or *any* code for that matter) that actually uses sethostent() or setgrent(), I am officially declaring them *worthless*.