PreviousUpNext

14.3.4  Posix_File

The standard library Posix_File api is a sub-API of the Posixlib api.

The above information is manually maintained and may contain errors.

api {
    eqtype User_Id;
    eqtype Group_Id;
    eqtype File_Descriptor;
    fd_to_int : File_Descriptor -> Int;
    int_to_fd : Int -> File_Descriptor;
    fd_to_iod : File_Descriptor -> Int;
    iod_to_fd : Int -> File_Descriptor;
    Directory_Stream;
    open_directory_stream : String -> Directory_Stream;
    read_directory_entry : Directory_Stream -> Null_Or(String );
    rewind_directory_stream : Directory_Stream -> Void;
    close_directory_stream : Directory_Stream -> Void;
    change_directory : String -> Void;
    current_directory : Void -> String;
    stdin : File_Descriptor;
    stdout : File_Descriptor;
    stderr : File_Descriptor;
        package s
          : api {
                Mode;
                Flags  = Mode;
                to_unt : Flags -> one_word_unt::Unt;
                from_unt : one_word_unt::Unt -> Flags;
                all : Flags;
                flags : List(Flags ) -> Flags;
                intersect : List(Flags ) -> Flags;
                clear : (Flags , Flags) -> Flags;
                all_set : (Flags , Flags) -> Bool;
                any_set : (Flags , Flags) -> Bool;
                irwxu : Mode;
                irusr : Mode;
                iwusr : Mode;
                ixusr : Mode;
                irwxg : Mode;
                irgrp : Mode;
                iwgrp : Mode;
                ixgrp : Mode;
                irwxo : Mode;
                iroth : Mode;
                iwoth : Mode;
                ixoth : Mode;
                isuid : Mode;
                isgid : Mode;};;
    mode_0755 : s::Mode;
    mode_0700 : s::Mode;
    mode_0666 : s::Mode;
    mode_0644 : s::Mode;
    mode_0600 : s::Mode;
        package o
          : api {
                eqtype Flags;
                to_unt : Flags -> one_word_unt::Unt;
                from_unt : one_word_unt::Unt -> Flags;
                all : Flags;
                flags : List(Flags ) -> Flags;
                intersect : List(Flags ) -> Flags;
                clear : (Flags , Flags) -> Flags;
                all_set : (Flags , Flags) -> Bool;
                any_set : (Flags , Flags) -> Bool;
                append : Flags;
                dsync : Flags;
                excl : Flags;
                noctty : Flags;
                nonblock : Flags;
                rsync : Flags;
                sync : Flags;
                trunc : Flags;};;
    Open_Mode  = O_RDONLY | O_RDWR | O_WRONLY;
    openf : (String , Open_Mode , o::Flags) -> File_Descriptor;
    createf : (String , Open_Mode , o::Flags , s::Mode) -> File_Descriptor;
    creat : (String , s::Mode) -> File_Descriptor;
    umask : s::Mode -> s::Mode;
    link : {new:String, old:String} -> Void;
    mkstemp : Void -> File_Descriptor;
    mkdir : (String , s::Mode) -> Void;
    make_named_pipe : (String , s::Mode) -> Void;
    unlink : String -> Void;
    rmdir : String -> Void;
    rename : {from:String, to:String} -> Void;
    symlink : {new:String, old:String} -> Void;
    readlink : String -> String;
    ftruncate : (File_Descriptor , Int) -> Void;
    eqtype Device;
    unt_to_dev : one_word_unt::Unt -> Device;
    dev_to_unt : Device -> one_word_unt::Unt;
    eqtype Inode;
    unt_to_ino : one_word_unt::Unt -> Inode;
    ino_to_unt : Inode -> one_word_unt::Unt;
        package stat
          : api {     Stat  =       {atime:time::Time, ctime:time::Time, dev:Int, ftype:Int, gid:one_word_unt::Unt, inode:Int,
                                    mode:s::Flags, mtime:time::Time, nlink:Int, size:Int, uid:one_word_unt::Unt};
                is_directory : Stat -> Bool;
                is_char_dev : Stat -> Bool;
                is_block_dev : Stat -> Bool;
                is_file : Stat -> Bool;
                is_pipe : Stat -> Bool;
                is_symlink : Stat -> Bool;
                is_socket : Stat -> Bool;
                mode : Stat -> s::Mode;
                inode : Stat -> Int;
                dev : Stat -> Int;
                nlink : Stat -> Int;
                uid : Stat -> User_Id;
                gid : Stat -> Group_Id;
                size : Stat -> Int;
                atime : Stat -> time::Time;
                mtime : Stat -> time::Time;
                ctime : Stat -> time::Time;};;
    stat : String -> stat::Stat;
    lstat : String -> stat::Stat;
    fstat : File_Descriptor -> stat::Stat;
    Access_Mode  = MAY_EXECUTE | MAY_READ | MAY_WRITE;
    access : (String , List(Access_Mode )) -> Bool;
    chmod : (String , s::Mode) -> Void;
    fchmod : (File_Descriptor , s::Mode) -> Void;
    chown : (String , User_Id , Group_Id) -> Void;
    fchown : (File_Descriptor , User_Id , Group_Id) -> Void;
    utime : (String , Null_Or({actime:time::Time, modtime:time::Time} )) -> Void;
    pathconf : (String , String) -> Null_Or(one_word_unt::Unt );
    fpathconf : (File_Descriptor , String) -> Null_Or(one_word_unt::Unt );
    osval3__syscall : String -> Int;
        set__osval3__ref :
        ({fun_name:String, io_call:String -> Int, lib_name:String} -> String -> Int) -> Void;
    Ckit_Dirstream  = runtime::Chunk;
    opendir__syscall : String -> Ckit_Dirstream;
        set__opendir__ref :
            ({fun_name:String, io_call:String -> Ckit_Dirstream, lib_name:String} -> String -> Ckit_Dirstream)
            ->
            Void;
    readdir__syscall : Ckit_Dirstream -> String;
        set__readdir__ref :
            ({fun_name:String, io_call:Ckit_Dirstream -> String, lib_name:String} -> Ckit_Dirstream -> String)
            ->
            Void;
    rewinddir__syscall : Ckit_Dirstream -> Void;
        set__rewinddir__ref :
            ({fun_name:String, io_call:Ckit_Dirstream -> Void, lib_name:String} -> Ckit_Dirstream -> Void)
            ->
            Void;
    closedir__syscall : Ckit_Dirstream -> Void;
        set__closedir__ref :
            ({fun_name:String, io_call:Ckit_Dirstream -> Void, lib_name:String} -> Ckit_Dirstream -> Void)
            ->
            Void;
    change_directory__syscall : String -> Void;
        set__change_directory__ref :
        ({fun_name:String, io_call:String -> Void, lib_name:String} -> String -> Void) -> Void;
    current_directory__syscall : Void -> String;
        set__current_directory__ref :
        ({fun_name:String, io_call:Void -> String, lib_name:String} -> Void -> String) -> Void;
    openf__syscall : (String , one_word_unt::Unt , one_word_unt::Unt) -> Int;
        set__openf__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt , one_word_unt::Unt) -> Int, lib_name:String}
                ->
                (String , one_word_unt::Unt , one_word_unt::Unt) -> Int
                )
            ->
            Void;
    mkstemp__syscall : Void -> Int;
        set__mkstemp__ref :
        ({fun_name:String, io_call:Void -> Int, lib_name:String} -> Void -> Int) -> Void;
    umask__syscall : one_word_unt::Unt -> one_word_unt::Unt;
        set__umask__ref :
                (
                {fun_name:String, io_call:one_word_unt::Unt -> one_word_unt::Unt, lib_name:String}
                ->
                one_word_unt::Unt -> one_word_unt::Unt
                )
            ->
            Void;
    link__syscall : (String , String) -> Void;
        set__link__ref :
            ({fun_name:String, io_call:(String , String) -> Void, lib_name:String} -> (String , String) -> Void)
            ->
            Void;
    rename__syscall : (String , String) -> Void;
        set__rename__ref :
            ({fun_name:String, io_call:(String , String) -> Void, lib_name:String} -> (String , String) -> Void)
            ->
            Void;
    symlink__syscall : (String , String) -> Void;
        set__symlink__ref :
            ({fun_name:String, io_call:(String , String) -> Void, lib_name:String} -> (String , String) -> Void)
            ->
            Void;
    mkdir__syscall : (String , one_word_unt::Unt) -> Void;
        set__mkdir__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (String , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    make_named_pipe__syscall : (String , one_word_unt::Unt) -> Void;
        set__make_named_pipe__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (String , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    unlink__syscall : String -> Void;
        set__unlink__ref :
        ({fun_name:String, io_call:String -> Void, lib_name:String} -> String -> Void) -> Void;
    rmdir__syscall : String -> Void;
        set__rmdir__ref :
        ({fun_name:String, io_call:String -> Void, lib_name:String} -> String -> Void) -> Void;
    readlink__syscall : String -> String;
        set__readlink__ref :
        ({fun_name:String, io_call:String -> String, lib_name:String} -> String -> String) -> Void;
    ftruncate__syscall : (Int , Int) -> Void;
        set__ftruncate__ref :
        ({fun_name:String, io_call:(Int , Int) -> Void, lib_name:String} -> (Int , Int) -> Void) -> Void;
          Statrep  =    (   Int , one_word_unt::Unt , one_word_unt::Unt , one_word_unt::Unt , one_word_unt::Unt ,
                            one_word_unt::Unt , one_word_unt::Unt , Int , one_word_int::Int , one_word_int::Int ,
                            one_word_int::Int
                        );
    stat__syscall : String -> Statrep;
        set__stat__ref :
        ({fun_name:String, io_call:String -> Statrep, lib_name:String} -> String -> Statrep) -> Void;
    lstat__syscall : String -> Statrep;
        set__lstat__ref :
        ({fun_name:String, io_call:String -> Statrep, lib_name:String} -> String -> Statrep) -> Void;
    fstat__syscall : Int -> Statrep;
        set__fstat__ref :
        ({fun_name:String, io_call:Int -> Statrep, lib_name:String} -> Int -> Statrep) -> Void;
    access__syscall : (String , one_word_unt::Unt) -> Bool;
        set__access__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt) -> Bool, lib_name:String}
                ->
                (String , one_word_unt::Unt) -> Bool
                )
            ->
            Void;
    chmod__syscall : (String , one_word_unt::Unt) -> Void;
        set__chmod__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (String , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    fchmod__syscall : (Int , one_word_unt::Unt) -> Void;
        set__fchmod__ref :
                (
                {fun_name:String, io_call:(Int , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (Int , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    chown__syscall : (String , one_word_unt::Unt , one_word_unt::Unt) -> Void;
        set__chown__ref :
                (
                {fun_name:String, io_call:(String , one_word_unt::Unt , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (String , one_word_unt::Unt , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    fchown__syscall : (Int , one_word_unt::Unt , one_word_unt::Unt) -> Void;
        set__fchown__ref :
                (
                {fun_name:String, io_call:(Int , one_word_unt::Unt , one_word_unt::Unt) -> Void, lib_name:String}
                ->
                (Int , one_word_unt::Unt , one_word_unt::Unt) -> Void
                )
            ->
            Void;
    utime__syscall : (String , one_word_int::Int , one_word_int::Int) -> Void;
        set__utime__ref :
                (
                {fun_name:String, io_call:(String , one_word_int::Int , one_word_int::Int) -> Void, lib_name:String}
                ->
                (String , one_word_int::Int , one_word_int::Int) -> Void
                )
            ->
            Void;
    pathconf__syscall : (String , String) -> Null_Or(one_word_unt::Unt );
        set__pathconf__ref :
                (
                {fun_name:String, io_call:(String , String) -> Null_Or(one_word_unt::Unt ), lib_name:String}
                ->
                (String , String) -> Null_Or(one_word_unt::Unt )
                )
            ->
            Void;
    fpathconf__syscall : (Int , String) -> Null_Or(one_word_unt::Unt );
        set__fpathconf__ref :
                (
                {fun_name:String, io_call:(Int , String) -> Null_Or(one_word_unt::Unt ), lib_name:String}
                ->
                (Int , String) -> Null_Or(one_word_unt::Unt )
                )
            ->
            Void;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext