PreviousUpNext

15.3.578  src/lib/std/src/winix/winix-file.api

## winix-file.api
#
# The generic file system interface.
#
# A sub-api of api Winix__Premicrothread:
#
#     src/lib/std/src/winix/winix--premicrothread.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib


stipulate
    package fp  =  file_position;                                                       # file_position         is from   src/lib/std/types-only/bind-position-31.pkg
    package tim =  time;                                                                # time                  is from   src/lib/std/types-only/basis-time.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/std/src/posix/winix-file.pkg
    #     src/lib/std/src/win32/os-file-system.pkg                                      # Does not currently compile.
    #
    api Winix_File {
        #
        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;
        make_directory:          String -> Void;
        remove_directory:        String -> Void;
        is_directory:            String -> Bool;

        is_symlink:              String -> Bool;
        read_symlink:            String -> String;

        full_path:  String -> String;
        real_path:  String -> String;

        file_size:  String -> fp::Int;

        last_file_modification_time:   String -> tim::Time;
        set_last_file_modification_time:   (String, Null_Or(tim::Time)) -> Void;

        remove_file:    String -> Void;
        rename_file:    { from:  String,  to:  String } -> Void;

        Access_Mode = MAY_READ | MAY_WRITE | MAY_EXECUTE;

        access:  (String, List( Access_Mode )) -> Bool;

        tmp_name:  Void -> String;                                                              # NB: posix::mkstemp is considered more secure, when applicable.

        eqtype File_Id;

        file_id:   String -> File_Id;
        hash:     File_Id -> Unt;
        compare:  (File_Id, File_Id) -> Order;



        #######################################################################
        # Below stuff is intended only for one-time use during
        # booting, to switch from direct to indirect syscalls:                                  # For background see Note[1]            in   src/lib/std/src/unsafe/mythryl-callable-c-library-interface.pkg

             tmp_name__syscall:    Void -> String;
        set__tmp_name__ref:      ({ lib_name: String, fun_name: String, io_call: (Void -> String) } -> (Void -> String)) -> Void;

    };                                                                                          # Winix_File
end;



## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext