Process handling categories
Platform
File system
Signal Handling

File system [XL]

XL CLAIRE comes with a set of method used for the file system management. These methods are used to :


categories File system Core global variable

*fs* : string := (if externC("\n#ifdef CLPC\nCTRUE\n#else\nCFALSE\n#endif\n", boolean) "\\" else "/")

*fs* is a global variable that is set to a string that represent the file separator (system dependent). Usually "/" on UNIX and "< "> on windows.


categories File system Core global variable

*ps* : string := (if externC("\n#ifdef CLPC\nCTRUE\n#else\nCFALSE\n#endif\n", boolean) ";" else ":")

*ps* is a global variable that is set to a string that represent the path separator (system dependent). Usually ":" on UNIX and ";" on windows.


categories File systemnormal dispatch [XL] Kernel method

chmod(s:string, m:integer) -> void

chmod(s, m) changes the mode of the file or directory s to m.


categories File systemnormal dispatch [XL] Kernel method

entries(s:string) -> list[string]

entries(s) returns the list of entries (files and sub-directories names) located in the directory s.


categories File systemnormal dispatch [XL] Kernel method

entries(s:string, w:string) -> list[string]

entries(s, w) returns the subset of entries (files and sub-directories names) located in the directory s that match the wildcard w (according to match_wilcard?). entries(s) is equivalent to entries(s, "*").


categories File systemnormal dispatch [XL] Kernel method

faccessed(s:string) -> float

faccessed(s) returns the time when the file s was last accessed (e.g. the time of the last read operation)


categories File systemnormal dispatch [XL] Kernel method

fchanged(s:string) -> float

fchanged(s) returns the time when the status of file s was last changed (the time of the last write operation or the time of the last fmode call or the time of the last unlink...)


categories File systemnormal dispatch [XL] Kernel method

fcopy(s1:string, s2:string) -> void

fcopy(s1,s2) copies the file s1 to a file named s2, if the copy is successful then the mode of s2 (according to fmode) is set to the same mode as s1.


categories File systemnormal dispatch [XL] Kernel method

fmode(s:string) -> integer

fmode(s) returns the mode of the file s.


categories File systemnormal dispatch [XL] Kernel method

fmodified(s:string) -> float

fmodified(s) returns the time when the file s was last modified (e.g. the time of the last write operation)


categories File systemnormal dispatch [XL] Kernel method

fsize(s:string) -> float

fsize(s) returns the size in bytes of the file s. The returned value is a float and not an integer that could overflow for big files.


categories File systemnormal dispatch [XL] Kernel method

isdir?(s:string) -> boolean

Tells if s represents an existing directory entry.


categories File systemnormal dispatch [XL] Kernel method

isfile?(s:string) -> boolean

Tells if s represents an existing file entry.


categories File systemnormal dispatch [XL] Kernel method

link(s1:string, s2:string) -> void

creates a hard link for the file s1 with name s2.


categories File systemnormal dispatch [XL] Kernel method

mkdir(s:string) -> void

mkdir(s) is equivalent to mkdir(s, <777)>


categories File systemnormal dispatch [XL] Kernel method

mkdir(s:string, m:integer) -> void

mkdir(s, m) creates a new directory s with mode m.


categories File systemnormal dispatch [XL] Kernel method

rmdir(s:string) -> void

rmdir(s) removes the directory s. The directory have to be empty and the calling process must have sufficient permissions.


categories File systemnormal dispatch [XL] Kernel method

symlink(s1:string, s2:string) -> void

creates a symbolic link for the file s1 with name s2.


categories File systemnormal dispatch [XL] Kernel method

unlink(s:string) -> void

unlink(s) removes the file s from the disk. note that the the file may still exists after the call since an other process may have it already open...