Overview  Index  Help 
Standard ML Basis Library

POSIX_FILE_SYS


signature POSIX_FILE_SYS =
sig
  structure S :
  sig
    include POSIX_FLAGS
    type mode
    sharing type mode = flags
    val irwxu : mode
    val irusr : mode
    val iwusr : mode
    val ixusr : mode
    val irwxg : mode
    val irgrp : mode
    val iwgrp : mode
    val ixgrp : mode
    val irwxo : mode
    val iroth : mode
    val iwoth : mode
    val ixoth : mode
    val isuid : mode
    val isgid : mode
  end
  structure O :
  sig
    include POSIX_FLAGS
    val append : flags
    val dsync : flags
    val excl : flags
    val noctty : flags
    val nonblock : flags
    val rsync : flags
    val sync : flags
    val trunc : flags
  end
  structure ST :
  sig
    type stat
    val isDir : stat -> bool
    val isChr : stat -> bool
    val isBlk : stat -> bool
    val isReg : stat -> bool
    val isFIFO : stat -> bool
    val isLink : stat -> bool
    val isSock : stat -> bool
    val mode : stat -> S.mode
    val ino : stat -> ino
    val dev : stat -> dev
    val nlink : stat -> int
    val uid : stat -> uid
    val gid : stat -> gid
    val size : stat -> Position.int
    val atime : stat -> Time.time
    val mtime : stat -> Time.time
    val ctime : stat -> Time.time
  end
  eqtype uid
  eqtype gid
  eqtype file_desc
  type dirstream
  eqtype dev
  eqtype ino
  datatype open_mode = O_RDONLY | O_WRONLY | O_RDWR
  datatype access_mode = A_READ | A_WRITE | A_EXEC
  val fdToWord : file_desc -> SysWord.word
  val wordToFD : SysWord.word -> file_desc
  val fdToIOD : file_desc -> OS.IO.iodesc
  val iodToFD : OS.IO.iodesc -> file_desc option
  val opendir : string -> dirstream
  val readdir : dirstream -> string option
  val rewinddir : dirstream -> unit
  val closedir : dirstream -> unit
  val chdir : string -> unit
  val getcwd : unit -> string
  val stdin : file_desc
  val stdout : file_desc
  val stderr : file_desc
  val openf : string * open_mode * O.flags -> file_desc
  val createf : string * open_mode * O.flags * S.mode -> file_desc
  val creat : string * S.mode -> file_desc
  val umask : S.mode -> S.mode
  val link : {old : string, new : string} -> unit
  val mkdir : string * S.mode -> unit
  val mkfifo : string * S.mode -> unit
  val unlink : string -> unit
  val rmdir : string -> unit
  val rename : {old : string, new : string} -> unit
  val symlink : {old : string, new : string} -> unit
  val readlink : string -> string
  val ftruncate : file_desc * Position.int -> unit
  val wordToDev : SysWord.word -> dev
  val devToWord : dev -> SysWord.word
  val wordToIno : SysWord.word -> ino
  val inoToWord : ino -> SysWord.word
  val stat : string -> ST.stat
  val lstat : string -> ST.stat
  val fstat : file_desc -> ST.stat
  val access : string * access_mode list -> bool
  val chmod : string * S.mode -> unit
  val fchmod : file_desc * S.mode -> unit
  val chown : string * uid * gid -> unit
  val fchown : file_desc * uid * gid -> unit
  val utime : string * {actime : Time.time, modtime : Time.time} option -> unit
  val pathconf : string * string -> SysWord.word option
  val fpathconf : file_desc * string -> SysWord.word option
end

 
Type detail

uid

eqtype uid


gid

eqtype gid


file_desc

eqtype file_desc


dirstream

type dirstream


dev

eqtype dev


ino

eqtype ino

 
Datatype detail

open_mode

datatype open_mode = O_RDONLY | O_WRONLY | O_RDWR


access_mode

datatype access_mode = A_READ | A_WRITE | A_EXEC

 
DataConstructor detail

O_RDONLY

constructor O_RDONLY : open_mode


O_WRONLY

constructor O_WRONLY : open_mode


O_RDWR

constructor O_RDWR : open_mode


A_READ

constructor A_READ : access_mode


A_WRITE

constructor A_WRITE : access_mode


A_EXEC

constructor A_EXEC : access_mode

 
Value detail

fdToWord

val fdToWord : file_desc -> SysWord.word


wordToFD

val wordToFD : SysWord.word -> file_desc


fdToIOD

val fdToIOD : file_desc -> OS.IO.iodesc


iodToFD

val iodToFD : OS.IO.iodesc -> file_desc option


opendir

val opendir : string -> dirstream


readdir

val readdir : dirstream -> string option


rewinddir

val rewinddir : dirstream -> unit


closedir

val closedir : dirstream -> unit


chdir

val chdir : string -> unit


getcwd

val getcwd : unit -> string


stdin

val stdin : file_desc


stdout

val stdout : file_desc


stderr

val stderr : file_desc


openf

val openf : string * open_mode * O.flags -> file_desc


createf

val createf : string * open_mode * O.flags * S.mode -> file_desc


creat

val creat : string * S.mode -> file_desc


umask

val umask : S.mode -> S.mode


link

val link : {old : string, new : string} -> unit


mkdir

val mkdir : string * S.mode -> unit


mkfifo

val mkfifo : string * S.mode -> unit


unlink

val unlink : string -> unit


rmdir

val rmdir : string -> unit


rename

val rename : {old : string, new : string} -> unit


symlink

val symlink : {old : string, new : string} -> unit


readlink

val readlink : string -> string


ftruncate

val ftruncate : file_desc * Position.int -> unit


wordToDev

val wordToDev : SysWord.word -> dev


devToWord

val devToWord : dev -> SysWord.word


wordToIno

val wordToIno : SysWord.word -> ino


inoToWord

val inoToWord : ino -> SysWord.word


stat

val stat : string -> ST.stat


lstat

val lstat : string -> ST.stat


fstat

val fstat : file_desc -> ST.stat


access

val access : string * access_mode list -> bool


chmod

val chmod : string * S.mode -> unit


fchmod

val fchmod : file_desc * S.mode -> unit


chown

val chown : string * uid * gid -> unit


fchown

val fchown : file_desc * uid * gid -> unit


utime

val utime : string * {actime : Time.time, modtime : Time.time} option -> unit


pathconf

val pathconf : string * string -> SysWord.word option


fpathconf

val fpathconf : file_desc * string -> SysWord.word option

 


Overview  Index  Help 
Standard ML Basis Library

This document may be distributed freely over the internet as long as the copyright notice and license terms below are prominently displayed within every machine-readable copy.

Copyright © 2003 AT&T and Lucent Technologies. All rights reserved.

Permission is granted for internet users to make one paper copy for their own personal use. Further hardcopy reproduction is strictly prohibited. Permission to distribute the HTML document electronically on any medium other than the internet must be requested from the copyright holders by contacting the editors. Printed versions of the SML Basis Manual are available from Cambridge University Press. To order, please visit www.cup.org (North America) or www.cup.cam.ac.uk (outside North America).