I would like to add some function into core.sys.posix.sys.stat

bioinfornatics bioinfornatics at fedoraproject.org
Sun Jun 16 16:00:21 PDT 2013


@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; }


More information about the Digitalmars-d mailing list