package uwt

  1. Overview
  2. Docs
type uv_open_flag = Uwt_base.Fs_types.uv_open_flag =
  1. | O_RDONLY
    (*

    Open for reading

    *)
  2. | O_WRONLY
    (*

    Open for writing

    *)
  3. | O_RDWR
    (*

    Open for reading and writing

    *)
  4. | O_NONBLOCK
    (*

    Open in non-blocking mode, ignored on Windows

    *)
  5. | O_CREAT
    (*

    Create if nonexistent

    *)
  6. | O_EXCL
    (*

    Fail if existing

    *)
  7. | O_TRUNC
    (*

    Truncate to 0 length if existing

    *)
  8. | O_APPEND
    (*

    Open for append

    *)
  9. | O_NOCTTY
    (*

    Don't make this dev a controlling tty, ignored on Windows

    *)
  10. | O_DSYNC
    (*

    Writes complete as `Synchronised I/O data integrity completion', ignored by some platforms

    *)
  11. | O_SYNC
    (*

    Writes complete as `Synchronised I/O file integrity completion', ignored by some platforms

    *)
  12. | O_RSYNC
    (*

    Reads complete as writes (depending on O_SYNC/O_DSYNC), only supported on some Unix platforms, ignored otherwise

    *)
  13. | O_TEMPORARY
    (*

    windows only, ignored on Unix

    *)
  14. | O_SHORT_LIVED
    (*

    windows only, ignored on Unix

    *)
  15. | O_SEQUENTIAL
    (*

    windows only, ignored on Unix

    *)
  16. | O_RANDOM
    (*

    windows only, ignored on Unix

    *)
  17. | O_DIRECT
    (*

    On Windows supported since libuv 1.16

    *)
  18. | O_EXLOCK
    (*

    OS X (and Windows, but with different semantic)

    *)
  19. | O_NOATIME
    (*

    no windows, some Unix systems, ignored otherwise

    *)
  20. | O_NOFOLLOW
    (*

    no windows, some Unix systems, ignored otherwise

    *)
  21. | O_DIRECTORY
    (*

    no windows, some Unix systems, ignored otherwise

    *)

Flags for Fs_functions.openfile

O_CLOEXEC doesn't exist, because this flag is unconditionally added by libuv. O_SHARE_DELETE, O_SHARE_WRITE, O_SHARE_READ are always added on Windows, unless O_EXLOCK is specified.

type file_kind = Uwt_base.Fs_types.file_kind =
  1. | S_REG
    (*

    Regular file

    *)
  2. | S_DIR
    (*

    Directory

    *)
  3. | S_CHR
    (*

    Character device

    *)
  4. | S_BLK
    (*

    Block device

    *)
  5. | S_LNK
    (*

    Symbolic link

    *)
  6. | S_FIFO
    (*

    Named pipe

    *)
  7. | S_SOCK
    (*

    Socket

    *)
  8. | S_UNKNOWN
    (*

    Everything else - possible on some platforms.

    *)

On Windows it can be specified how to create symlinks.

type access_permission = Uwt_base.Fs_types.access_permission =
  1. | Read
    (*

    Read permission

    *)
  2. | Write
    (*

    Write permission

    *)
  3. | Exec
    (*

    Execution permission

    *)
  4. | Exists
    (*

    File exists

    *)
type stats = Uwt_base.Fs_types.stats = {
  1. st_dev : int;
    (*

    Device number

    *)
  2. st_kind : file_kind;
    (*

    Kind of the file

    *)
  3. st_perm : int;
    (*

    Access rights

    *)
  4. st_uid : int;
    (*

    User id of the owner

    *)
  5. st_gid : int;
    (*

    Group ID of the file's group

    *)
  6. st_rdev : int;
    (*

    Device minor number

    *)
  7. st_ino : int;
    (*

    Inode number

    *)
  8. st_size : int64;
    (*

    Size in bytes

    *)
  9. st_blksize : int;
    (*

    "Preferred" block size for efficient filesystem I/O

    *)
  10. st_blocks : int;
    (*

    Number of blocks allocated to the file, in 512-byte units

    *)
  11. st_flags : int;
    (*

    User defined flags for file

    *)
  12. st_gen : int;
    (*

    File generation number

    *)
  13. st_atime : int64;
    (*

    Last access time

    *)
  14. st_atime_nsec : int;
    (*

    Nanosecond components of last access time

    *)
  15. st_mtime : int64;
    (*

    Last modification time

    *)
  16. st_mtime_nsec : int;
    (*

    Nanosecond components of last modification time

    *)
  17. st_ctime : int64;
    (*

    Last status change time

    *)
  18. st_ctime_nsec : int;
    (*

    Nanosecond components of lastt status change time

    *)
  19. st_birthtime : int64;
    (*

    File creation time

    *)
  20. st_birthtime_nsec : int;
    (*

    Nanosecond components of File creation time

    *)
}

File status information. Support for the various fields differs depending on the OS and filesystem.

type clone_mode =
  1. | No_clone
    (*

    Create a normal copy

    *)
  2. | Try_clone
    (*

    Try to clone the file, but create a normal copy, if it fails

    *)
  3. | Force_clone
    (*

    Try tlone the file, don't create a normal copy, if it fails

    *)

Clone mode for Fs_functions.copyfile

OCaml

Innovation. Community. Security.