91 sock ( 0b00000000000000000001000000000000 ),
93 blk ( 0b00000000000000000010000000000000 ),
95 chr ( 0b00000000000000000100000000000000 ),
97 fifo ( 0b00000000000000001000000000000000 ),
99 dir ( 0b00000000000000010000000000000000 ),
101 file ( 0b00000000000000100000000000000000 ),
103 link ( 0b00000000000001000000000000000000 ),
111 Bit(
final int v) { value = v; }
123 public boolean isSet(
final Bit bit) {
return bit.value == (
mask & bit.value ); }
133 final int r =
mask & bits;
134 if( r ==
mask ) {
return this; }
135 else {
return new FMode(r); }
138 private static native String to_string(
final int mask,
final boolean show_rwx);
142 return to_string(
mask,
false);
145 return to_string(
mask, show_rwx);
149 public boolean equals(
final Object other) {
153 return (other instanceof
FMode) &&
154 this.mask == ((
FMode)other).mask;
Generic file type and POSIX protection mode bits as used in file_stats, touch(), mkdir() etc.
static final FMode def_file
Default file protection bit: Safe default: POSIX S_IRUSR | S_IWUSR | S_IRGRP or read_usr | write_usr ...
boolean isSet(final Bit bit)
FMode mask(final int bits)
String toString(final boolean show_rwx)
boolean equals(final Object other)
static final FMode def_dir
Default directory protection bit: Safe default: POSIX S_IRWXU | S_IRGRP | S_IXGRP or rwx_usr | read_g...
file
Type: Entity is a file ), might be in combination with link.
write_grp
Protection bit: POSIX S_IWGRP.
rwx_oth
Protection bit: POSIX S_IRWXO.
protection_mask
12 bit protection bit mask 07777 for rwx_all | set_uid | set_gid | sticky .
sticky
Protection bit: POSIX S_ISVTX.
dir
Type: Entity is a directory ), might be in combination with link.
not_existing
Type: Entity does not exist ), exclusive bit.
read_usr
Protection bit: POSIX S_IRUSR.
write_oth
Protection bit: POSIX S_IWOTH.
fifo
Type: Entity is a fifo/pipe ), might be in combination with link.
def_dir_prot
Default directory protection bit: Safe default: POSIX S_IRWXU | S_IRGRP | S_IXGRP or rwx_usr | read_g...
blk
Type: Entity is a block device ), might be in combination with link.
rwx_grp
Protection bit: POSIX S_IRWXG.
type_mask
Type mask for sock | blk | chr | fifo | dir | file | link | no_access | not_existing.
link
Type: Entity is a symbolic link ), might be in combination with file or dir ), fifo ),...
rwx_all
Protection bit: POSIX S_IRWXU | S_IRWXG | S_IRWXO or rwx_usr | rwx_grp | rwx_oth.
exec_grp
Protection bit: POSIX S_IXGRP.
def_file_prot
Default file protection bit: Safe default: POSIX S_IRUSR | S_IWUSR | S_IRGRP or read_usr | write_usr ...
read_grp
Protection bit: POSIX S_IRGRP.
chr
Type: Entity is a character device ), might be in combination with link.
read_oth
Protection bit: POSIX S_IROTH.
exec_usr
Protection bit: POSIX S_IXUSR.
ugs_set
Protection bit: POSIX S_ISUID | S_ISGID | S_ISVTX.
rwx_usr
Protection bit: POSIX S_IRWXU.
exec_oth
Protection bit: POSIX S_IXOTH.
no_access
Type: Entity gives no access to user ), exclusive bit.
set_uid
Protection bit: POSIX S_ISUID.
sock
Type: Entity is a socket, might be in combination with link.
set_gid
Protection bit: POSIX S_ISGID.
write_usr
Protection bit: POSIX S_IWUSR.