Stories
Slash Boxes
Comments
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

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Thursday August 28, 2003
01:52 PM

/etc for win32, continued

[ #14372 ]
I've been diligently working on porting the /etc functions to the win32 platform. I've started with a Ruby version for now. Don't worry - when (if?) I've settled on the code, I'll submit it for Perl as well (it's mainly C).

Today I released sys-win32etc. The major change is that you can do lookups against a remote server instead of a local machine. Unfortunately, I have no way to test this - help wanted.

About the only *bad* news is that the memory leaks have gotten worse. I have no idea why. Not to panic, though - it doesn't matter unless you plan on calling these functions in a continuous loop (for whatever odd reason). Still, I'd like to nail them down.

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.

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

    by jhi (318) <jhi@iki.fi> on 2003.08.28 15:35 (#23625) Homepage Journal

    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.
        • 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*.