type file_perm = int let openfile name flags perms = if List.sort compare flags <> [ O_RDWR; O_CREAT] then implementation_error "Manadatory flags are [ O_RDWR; O_CREAT ]"; let inode = namei name in if inode.stats.st_kind = S_DIR then system_error EISDIR "openfile" name; { inode = inode; pos = 0; closed = false };; |