-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Etc
module with methods for fetching user information
#2368
Conversation
31f7009
to
357da24
Compare
property dir | ||
property shell | ||
|
||
def initialize(pwd : LibC::Passwd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say that LibC::Passwd should not appear here. The wrapper module should perform the conversion IMO.
Also, take a look at http://crystal-lang.org/api/toplevel.html#record%28name%2C%2Aproperties%29-macro you will probably like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Naming is hard, but I pushed a new commit trying to fix that. (As a separate commit for clarity, will squash it later.)
fun getlogin : Char* | ||
fun getpwnam(name : Char*) : Passwd* | ||
fun getpwuid(uid : UInt32) : Passwd* | ||
fun getuid : UInt32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getuid
should propably be defined somewhere else? In process.cs
?
Hola! Thank you for this. We have to analyze this a bit. It's way too unix specific. What would happen in Windows, this module won't be available? I think the standard library shouldn't have too platform-specific functionality, but I don't know. |
Seems that in Ruby the non-existing methods just return Your call, for me this was just a fun exercise. =) |
If we want this it should go to the new |
Yes, having this in |
Bindings for |
#codetriage
If that's correct and desirable, I'm happy to take a stab at this, but I'm uncertain of what Step 2 would be. |
Uses current conventions. Split out from crystal-lang#2368 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Uses current conventions. Split out from crystal-lang#2368 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
¡Hola!
Would you like to include Ruby inspired
Etc
module to the standard library? Or do I publish it as shard?Disclaimer: I just started playing with the cool new language today, so might have some funny things in it.