PreviousUpNext

14.4.138  Winix

The standard library Winix api defines access to cross-platform OS functionality usable on both Windows and Posix (thus “Winix”) platforms. The Winix api is thus an alternative to the Posix_1003_1b api offering increased portability at the cost of reduced functionality.

The Winix api is implemented by the winix package.

The Winix api source code is in src/lib/std/src/winix/winix.api.

See also: Posix_1003_1b.

The above information is manually maintained and may contain errors.

api {
    System_Error ;
    error_name : System_Error -> String;
    syserror : String -> Null_Or(System_Error );
    error_msg : System_Error -> String;
    exception RUNTIME_EXCEPTION (String , Null_Or(System_Error ));
    package file : api {
                       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 -> Int;
                       last_file_modification_time : String -> time::Time;
                       set_last_file_modification_time : (String , Null_Or(time::Time )) -> Void;
                       remove_file : String -> Void;
                       rename_file : {from:String,  to:String} -> Void;
                       Access_Mode  = MAY_EXECUTE | MAY_READ | MAY_WRITE;
                       access : (String , List(Access_Mode )) -> Bool;
                       tmp_name : Void -> String;
                       eqtype File_Id ;
                       file_id : String -> File_Id;
                       hash : File_Id -> Unt;
                       compare : (File_Id , File_Id) -> Order;
                   };;
    package path : api {
                       exception PATH;
                       parent_arc : String;
                       current_arc : String;
                       volume_is_valid : {disk_volume:String,  is_absolute:Bool} -> Bool;
                       from_string : String
                                     -> {arcs:List(String ),  disk_volume:String, 
                                         is_absolute:Bool};
                       to_string : {arcs:List(String ),  disk_volume:String, 
                                    is_absolute:Bool}
                                   -> String;
                       get_volume : String -> String;
                       get_parent : String -> String;
                       split_path_into_dir_and_file : String -> {dir:String,  file:String};
                       make_path_from_dir_and_file : {dir:String,  file:String} -> String;
                       dir : String -> String;
                       file : String -> String;
                       split_base_ext : String -> {base:String,  ext:Null_Or(String )};
                       join_base_ext : {base:String,  ext:Null_Or(String )} -> String;
                       base : String -> String;
                       ext : String -> Null_Or(String );
                       make_canonical : String -> String;
                       is_canonical : String -> Bool;
                       make_absolute : {path:String,  relative_to:String} -> String;
                       make_relative : {path:String,  relative_to:String} -> String;
                       is_absolute : String -> Bool;
                       is_relative : String -> Bool;
                       is_root : String -> Bool;
                       cat : (String , String) -> String;
                       from_unix_path : String -> String;
                       to_unix_path : String -> String;
                   };;
    package process : api {
                          Status  = Int;
                          success : Status;
                          failure : Status;
                          successful : Status -> Bool;
                          system : String -> Status;
                          at_exit : (Void -> Void) -> Void;
                          exit : Status -> X;
                          terminate : Status -> X;
                          get_env : String -> Null_Or(String );
                          sleep : Float -> Void;
                          get_process_id : Void -> Int;
                      };;
    package io : api {
                     eqtype Io_Descriptor ;
                     eqtype Io_Descriptor_Kind ;
                     hash : Io_Descriptor -> Unt;
                     compare : (Io_Descriptor , Io_Descriptor) -> Order;
                     kind : Io_Descriptor -> Io_Descriptor_Kind;
                     package kind : api {
                                        file : Io_Descriptor_Kind;
                                        dir : Io_Descriptor_Kind;
                                        symlink : Io_Descriptor_Kind;
                                        tty : Io_Descriptor_Kind;
                                        pipe : Io_Descriptor_Kind;
                                        socket : Io_Descriptor_Kind;
                                        device : Io_Descriptor_Kind;
                                    };;
                     Wait_Request  = {io_descriptor:Io_Descriptor,  oobdable:Bool, 
                                      readable:Bool,  writable:Bool};
                     Wait_Result  = Wait_Request;
                     exception BAD_WAIT_REQUEST;
                     wait_for_io_opportunity : {timeout:Null_Or(time::Time ), 
                                                wait_requests:List(Wait_Request )}
                                               -> List(Wait_Result );
                     select : {timeout:Null_Or(time::Time ), 
                               wait_requests:List(Wait_Request )}
                              -> List(Wait_Result );
                 };;
};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext