Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Platform independant getpwnam?

19 views
Skip to first unread message

gga

unread,
Mar 8, 2005, 4:28:05 PM3/8/05
to

On linux:
require 'etc'
uid = Etc::getpwnam(username).uid

this works fine, but on windows, this fails miserably. Is there a
platform independent way of getting the uid for any username (so as to
later use that uid against File::Stat.uid)?

Daniel Berger

unread,
Mar 8, 2005, 4:54:21 PM3/8/05
to

require "win32/etc"
include Win32

uid = Etc.getpwnam(username).uid

Regards,

Dan

PS - Keep an eye out for the sys-admin package, coming soon.
PS2 - I plan on redefining File.stat in the win32-file package.

0 new messages