June 16, 2013 I would like to add some function into core.sys.posix.sys.stat | ||||
---|---|---|---|---|
| ||||
@safe pure nothrow bool userHasRead( mode_t mode ) { return ( mode & S_IRUSR ) == S_IRUSR; } @safe pure nothrow bool userHasWrite( mode_t mode ) { return ( mode & S_IWUSR ) == S_IWUSR; } @safe pure nothrow bool userHasExecution( mode_t mode ) { return ( mode & S_IXUSR ) == S_IXUSR; } Dear, what do you think to add some sugar into this module. i use these furction but is maybe better inside core.sys.posix.sys.stat @safe pure nothrow bool groupHasRead( mode_t mode ) { return ( mode & S_IRGRP ) == S_IRGRP; } @safe pure nothrow bool groupHasWrite( mode_t mode ) { return ( mode & S_IWGRP ) == S_IWGRP; } @safe pure nothrow bool groupHasExecution( mode_t mode ) { return ( mode & S_IXGRP ) == S_IXGRP; } @safe pure nothrow bool otherHasRead( mode_t mode ) { return ( mode & S_IROTH ) == S_IROTH; } @safe pure nothrow bool otherHasWrite( mode_t mode ) { return ( mode & S_IWOTH ) == S_IWOTH; } @safe pure nothrow bool otherHasExecution( mode_t mode ) { return ( mode & S_IXOTH ) == S_IXOTH; } |
June 16, 2013 Re: I would like to add some function into core.sys.posix.sys.stat | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | On Monday, June 17, 2013 01:00:21 bioinfornatics wrote:
> what do you think to add some sugar into this module. i use these furction but is maybe better inside core.sys.posix.sys.stat
I don't think that we should be adding any sugar to core.sys. It's specifically for providing bindings to the OS APIs, not for wrapping them. Phobos is where the wrappers go. In this case, the correct place would be std.file.
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation