Module os

This module contains basic operating system facilities like retrieving environment variables, reading command line arguments, working with directories, running shell commands, etc.

Types

FReadEnv = object of FReadIO
effect that denotes a read from an environment variable See source
FWriteEnv = object of FWriteIO
effect that denotes a write to an environment variable See source
FReadDir = object of FReadIO
effect that denotes a write operation to the directory structure See source
FWriteDir = object of FWriteIO
effect that denotes a write operation to the directory structure See source
TOSErrorCode = distinct int32
Specifies an OS Error Code. See source
TFilePermission = enum 
  fpUserExec,                 ## execute access for the file owner
  fpUserWrite,                ## write access for the file owner
  fpUserRead,                 ## read access for the file owner
  fpGroupExec,                ## execute access for the group
  fpGroupWrite,               ## write access for the group
  fpGroupRead,                ## read access for the group
  fpOthersExec,               ## execute access for others
  fpOthersWrite,              ## write access for others
  fpOthersRead                ## read access for others
file access permission; modelled after UNIX See source
TPathComponent = enum 
  pcFile,                     ## path refers to a file
  pcLinkToFile,               ## path refers to a symbolic link to a file
  pcDir,                      ## path refers to a directory
  pcLinkToDir                 ## path refers to a symbolic link to a directory
Enumeration specifying a path component. See source
DeviceId = TDev
See source
FileId = Tino
See source

Consts

CurDir = '.'

The constant string used by the operating system to refer to the current directory.

For example: '.' for POSIX or ':' for the classic Macintosh.

See source
ParDir = ".."

The constant string used by the operating system to refer to the parent directory.

For example: ".." for POSIX or "::" for the classic Macintosh.

See source
DirSep = '/'
The character used by the operating system to separate pathname components, for example, '/' for POSIX or ':' for the classic Macintosh. See source
AltSep = '/'
An alternative character used by the operating system to separate pathname components, or the same as DirSep if only one separator character exists. This is set to '/' on Windows systems where DirSep is a backslash. See source
PathSep = ':'
The character conventionally used by the operating system to separate search patch components (as in PATH), such as ':' for POSIX or ';' for Windows. See source
FileSystemCaseSensitive = true
True if the file system is case sensitive, false otherwise. Used by cmpPaths to compare filenames properly. See source
ExeExt = ""
The file extension of native executables. For example: "" for POSIX, "exe" on Windows. See source
ScriptExt = ""
The file extension of a script file. For example: "" for POSIX, "bat" on Windows. See source
DynlibFormat = "lib$1.so"
The format string to turn a filename into a DLL file (also called shared object on some operating systems). See source
ExtSep = '.'
The character which separates the base filename from the extension; for example, the '.' in os.nim. See source

Procs

proc osErrorMsg(): string {.rtl, extern: "nos$1", deprecated, raises: [], 
                            tags: [], uses: [].}

Retrieves the operating system's error flag, errno. On Windows GetLastError is checked before errno. Returns "" if no error occured.

Deprecated since version 0.9.4: use the other OSErrorMsg proc.

See source
proc osError(msg: string = "") {.noinline, rtl, extern: "nos$1", deprecated, 
                                 raises: [EOS, EOS], tags: [], uses: [].}

raises an EOS exception with the given message msg. If msg == "", the operating system's error flag (errno) is converted to a readable error message. On Windows GetLastError is checked before errno. If no error flag is set, the message unknown OS error is used.

Deprecated since version 0.9.4: use the other OSError proc.

See source
proc `==`(err1, err2: TOSErrorCode): bool {.borrow.}
See source
proc `$`(err: TOSErrorCode): string {.borrow.}
See source
proc osErrorMsg(errorCode: TOSErrorCode): string {.raises: [], tags: [], 
    uses: [].}

Converts an OS error code into a human readable string.

The error code can be retrieved using the OSLastError proc.

If conversion fails, or errorCode is 0 then "" will be returned.

On Windows, the -d:useWinAnsi compilation flag can be used to make this procedure use the non-unicode Win API calls to retrieve the message.

See source
proc osError(errorCode: TOSErrorCode) {.raises: [EOS], tags: [], uses: [].}

Raises an EOS exception. The errorCode will determine the message, OSErrorMsg will be used to get this message.

The error code can be retrieved using the OSLastError proc.

If the error code is 0 or an error message could not be retrieved, the message unknown OS error will be used.

See source
proc osLastError(): TOSErrorCode {.raises: [], tags: [], uses: [].}

Retrieves the last operating system error code.

This procedure is useful in the event when an OS call fails. In that case this procedure will return the error code describing the reason why the OS call failed. The OSErrorMsg procedure can then be used to convert this code into a string.

Warning: The behaviour of this procedure varies between Windows and POSIX systems. On Windows some OS calls can reset the error code to 0 causing this procedure to return 0. It is therefore advised to call this procedure immediately after an OS call fails. On POSIX systems this is not a problem.

See source
proc unixToNativePath(path: string; drive = ""): string {.noSideEffect, rtl, 
    extern: "nos$1", raises: [], tags: [], uses: [].}

Converts an UNIX-like path to a native one.

On an UNIX system this does nothing. Else it converts '/', '.', '..' to the appropriate things.

On systems with a concept of "drives", drive is used to determine which drive label to use during absolute path conversion. drive defaults to the drive of the current working directory, and is ignored on systems that do not have a concept of "drives".

See source
proc existsFile(filename: string): bool {.rtl, extern: "nos$1", 
    tags: [FReadDir], raises: [], uses: [].}
Returns true if the file exists, false otherwise. See source
proc existsDir(dir: string): bool {.rtl, extern: "nos$1", tags: [FReadDir], 
                                    raises: [], uses: [].}
Returns true iff the directory dir exists. If dir is a file, false is returned. See source
proc symlinkExists(link: string): bool {.rtl, extern: "nos$1", tags: [FReadDir], 
    raises: [], uses: [].}
Returns true iff the symlink link exists. Will return true regardless of whether the link points to a directory or file. See source
proc fileExists(filename: string): bool {.inline, raises: [], tags: [FReadDir], 
    uses: [].}
See source
proc dirExists(dir: string): bool {.inline, raises: [], tags: [FReadDir], 
                                    uses: [].}
See source
proc getLastModificationTime(file: string): TTime {.rtl, extern: "nos$1", 
    raises: [EOS], tags: [], uses: [].}
Returns the file's last modification time. See source
proc getLastAccessTime(file: string): TTime {.rtl, extern: "nos$1", 
    raises: [EOS], tags: [], uses: [].}
Returns the file's last read or write access time. See source
proc getCreationTime(file: string): TTime {.rtl, extern: "nos$1", raises: [EOS], 
    tags: [], uses: [].}
Returns the file's creation time. Note that under posix OS's, the returned time may actually be the time at which the file's attribute's were last modified. See source
proc fileNewer(a, b: string): bool {.rtl, extern: "nos$1", raises: [EOS], 
                                     tags: [], uses: [].}
Returns true if the file a is newer than file b, i.e. if a's modification time is later than b's. See source
proc getCurrentDir(): string {.rtl, extern: "nos$1", tags: [], raises: [EOS], 
                               uses: [].}
Returns the current working directory. See source
proc setCurrentDir(newDir: string) {.inline, tags: [], raises: [EOS], uses: [].}
Sets the current working directory; EOS is raised if newDir cannot been set. See source
proc joinPath(head, tail: string): string {.noSideEffect, rtl, extern: "nos$1", 
    raises: [], tags: [], uses: [].}

Joins two directory names to one.

For example on Unix:

joinPath("usr", "lib")

results in:

"usr/lib"

If head is the empty string, tail is returned. If tail is the empty string, head is returned with a trailing path separator. If tail starts with a path separator it will be removed when concatenated to head. Other path separators not located on boundaries won't be modified. More examples on Unix:

assert joinPath("usr", "") == "usr/"
assert joinPath("", "lib") == "lib"
assert joinPath("", "/lib") == "/lib"
assert joinPath("usr/", "/lib") == "usr/lib"
See source
proc joinPath(parts: varargs[string]): string {.noSideEffect, rtl, 
    extern: "nos$1OpenArray", raises: [], tags: [], uses: [].}
The same as joinPath(head, tail), but works with any number of directory parts. You need to pass at least one element or the proc will assert in debug builds and crash on release builds. See source
proc `/`(head, tail: string): string {.noSideEffect, raises: [], tags: [], 
                                       uses: [].}

The same as joinPath(head, tail)

Here are some examples for Unix:

assert "usr" / "" == "usr/"
assert "" / "lib" == "lib"
assert "" / "/lib" == "/lib"
assert "usr/" / "/lib" == "usr/lib"
See source
proc splitPath(path: string): tuple[head, tail: string] {.noSideEffect, rtl, 
    extern: "nos$1", raises: [], tags: [], uses: [].}

Splits a directory into (head, tail), so that joinPath(head, tail) == path.

Examples:

splitPath("usr/local/bin") -> ("usr/local", "bin")
splitPath("usr/local/bin/") -> ("usr/local/bin", "")
splitPath("bin") -> ("", "bin")
splitPath("/bin") -> ("", "bin")
splitPath("") -> ("", "")
See source
proc parentDir(path: string): string {.noSideEffect, rtl, extern: "nos$1", 
                                       raises: [], tags: [], uses: [].}

Returns the parent directory of path.

This is often the same as the head result of splitPath. If there is no parent, "" is returned.

Example: parentDir("/usr/local/bin") == "/usr/local".
Example: parentDir("/usr/local/bin/") == "/usr/local".

See source
proc isRootDir(path: string): bool {.noSideEffect, rtl, extern: "nos$1", 
                                     raises: [], tags: [], uses: [].}
Checks whether a given path is a root directory See source
proc `/../`(head, tail: string): string {.noSideEffect, raises: [], tags: [], 
    uses: [].}
The same as parentDir(head) / tail unless there is no parent directory. Then head / tail is performed instead. See source
proc splitFile(path: string): tuple[dir, name, ext: string] {.noSideEffect, rtl, 
    extern: "nos$1", raises: [], tags: [], uses: [].}

Splits a filename into (dir, filename, extension). dir does not end in DirSep. extension includes the leading dot.

Example:

var (dir, name, ext) = splitFile("usr/local/nimrodc.html")
assert dir == "usr/local"
assert name == "nimrodc"
assert ext == ".html"

If path has no extension, ext is the empty string. If path has no directory component, dir is the empty string. If path has no filename component, name and ext are empty strings.

See source
proc extractFilename(path: string): string {.noSideEffect, rtl, extern: "nos$1", 
    raises: [], tags: [], uses: [].}
Extracts the filename of a given path. This is the same as name & ext from splitFile(path). See source
proc expandFilename(filename: string): string {.rtl, extern: "nos$1", 
    tags: [FReadDir], raises: [EOS], uses: [].}
Returns the full path of filename, raises EOS in case of an error. See source
proc changeFileExt(filename, ext: string): string {.noSideEffect, rtl, 
    extern: "nos$1", raises: [], tags: [], uses: [].}

Changes the file extension to ext.

If the filename has no extension, ext will be added. If ext == "" then any extension is removed. Ext should be given without the leading '.', because some filesystems may use a different character. (Although I know of none such beast.)

See source
proc addFileExt(filename, ext: string): string {.noSideEffect, rtl, 
    extern: "nos$1", raises: [], tags: [], uses: [].}

Adds the file extension ext to filename, unless filename already has an extension.

Ext should be given without the leading '.', because some filesystems may use a different character. (Although I know of none such beast.)

See source
proc cmpPaths(pathA, pathB: string): int {.noSideEffect, rtl, extern: "nos$1", 
    raises: [], tags: [], uses: [].}

Compares two paths.

On a case-sensitive filesystem this is done case-sensitively otherwise case-insensitively. Returns:

0 iff pathA == pathB
< 0 iff pathA < pathB
> 0 iff pathA > pathB

See source
proc isAbsolute(path: string): bool {.rtl, noSideEffect, extern: "nos$1", 
                                      raises: [], tags: [], uses: [].}

Checks whether a given path is absolute.

On Windows, network paths are considered absolute too.

See source
proc sameFile(path1, path2: string): bool {.rtl, extern: "nos$1", 
    tags: [FReadDir], raises: [EOS], uses: [].}

Returns True if both pathname arguments refer to the same physical file or directory. Raises an exception if any of the files does not exist or information about it can not be obtained.

This proc will return true if given two alternative hard-linked or sym-linked paths to the same file or directory.

See source
proc sameFileContent(path1, path2: string): bool {.rtl, extern: "nos$1", 
    tags: [FReadIO], raises: [EOutOfMemory, E_Base], uses: [].}
Returns True if both pathname arguments refer to files with identical binary content. See source
proc getFilePermissions(filename: string): set[TFilePermission] {.rtl, 
    extern: "nos$1", tags: [FReadDir], raises: [EOS], uses: [].}
retrieves file permissions for filename. OSError is raised in case of an error. On Windows, only the readonly flag is checked, every other permission is available in any case. See source
proc setFilePermissions(filename: string; permissions: set[TFilePermission]) {.
    rtl, extern: "nos$1", tags: [FWriteDir], raises: [EOS], uses: [].}
sets the file permissions for filename. OSError is raised in case of an error. On Windows, only the readonly flag is changed, depending on fpUserWrite. See source
proc copyFile(source, dest: string) {.rtl, extern: "nos$1", 
                                      tags: [FReadIO, FWriteIO], 
                                      raises: [EOutOfMemory, EOS, E_Base], 
                                      uses: [].}

Copies a file from source to dest.

If this fails, EOS is raised. On the Windows platform this proc will copy the source file's attributes into dest. On other platforms you need to use getFilePermissions and setFilePermissions to copy them by hand (or use the convenience copyFileWithPermissions() proc), otherwise dest will inherit the default permissions of a newly created file for the user. If dest already exists, the file attributes will be preserved and the content overwritten.

See source
proc moveFile(source, dest: string) {.rtl, extern: "nos$1", 
                                      tags: [FReadIO, FWriteIO], raises: [EOS], 
                                      uses: [].}
Moves a file from source to dest. If this fails, EOS is raised. See source
proc removeFile(file: string) {.rtl, extern: "nos$1", tags: [FWriteDir], 
                                raises: [EOS], uses: [].}
Removes the file. If this fails, EOS is raised. This does not fail if the file never existed in the first place. On Windows, ignores the read-only attribute. See source
proc execShellCmd(command: string): int {.rtl, extern: "nos$1", tags: [FExecIO], 
    raises: [], uses: [].}

Executes a shell command.

Command has the form 'program args' where args are the command line arguments given to program. The proc returns the error code of the shell when it has finished. The proc does not return until the process has finished. To execute a program without having a shell involved, use the execProcess proc of the osproc module.

See source
proc getEnv(key: string): TaintedString {.tags: [FReadEnv], raises: [], uses: [].}

Returns the value of the environment variable named key.

If the variable does not exist, "" is returned. To distinguish whether a variable exists or it's value is just "", call existsEnv(key).

See source
proc existsEnv(key: string): bool {.tags: [FReadEnv], raises: [], uses: [].}
Checks whether the environment variable named key exists. Returns true if it exists, false otherwise. See source
proc putEnv(key, val: string) {.tags: [FWriteEnv], raises: [EOS], uses: [].}
Sets the value of the environment variable named key to val. If an error occurs, EInvalidEnvVar is raised. See source
proc removeDir(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir, FReadDir], 
                              raises: [EOS], uses: [].}

Removes the directory dir including all subdirectories and files in dir (recursively).

If this fails, EOS is raised. This does not fail if the directory never existed in the first place.

See source
proc createDir(dir: string) {.rtl, extern: "nos$1", tags: [FWriteDir], 
                              raises: [EOS], uses: [].}

Creates the directory dir.

The directory may contain several subdirectories that do not exist yet. The full path is created. If this fails, EOS is raised. It does not fail if the path already exists because for most usages this does not indicate an error.

See source
proc copyDir(source, dest: string) {.rtl, extern: "nos$1", 
                                     tags: [FWriteIO, FReadIO], 
                                     raises: [EOS, EOutOfMemory, E_Base], 
                                     uses: [].}
Copies a directory from source to dest. If this fails, EOS is raised. See source

Create a symbolic link at dest which points to the item specified by src. On most operating systems, will fail if a lonk

Warning: Some OS's (such as Microsoft Windows) restrict the creation of symlinks to root users (administrators).

See source

Create a hard link at dest which points to the item specified by src.

Warning: Most OS's restrict the creation of hard links to root users (administrators) .

See source
proc parseCmdLine(c: string): seq[string] {.noSideEffect, rtl, extern: "nos$1", 
    raises: [], tags: [], uses: [].}

Splits a command line into several components; This proc is only occassionally useful, better use the parseopt module.

On Windows, it uses the following parsing rules (see http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ):

  • Arguments are delimited by white space, which is either a space or a tab.
  • The caret character (^) is not recognized as an escape character or delimiter. The character is handled completely by the command-line parser in the operating system before being passed to the argv array in the program.
  • A string surrounded by double quotation marks ("string") is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument.
  • A double quotation mark preceded by a backslash (") is interpreted as a literal double quotation mark character (").
  • Backslashes are interpreted literally, unless they immediately precede a double quotation mark.
  • If an even number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is interpreted as a string delimiter.
  • If an odd number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is "escaped" by the remaining backslash, causing a literal double quotation mark (") to be placed in argv.

On Posix systems, it uses the following parsing rules: Components are separated by whitespace unless the whitespace occurs within " or ' quotes.

See source
proc copyFileWithPermissions(source, dest: string; ignorePermissionErrors = true) {.
    raises: [EOutOfMemory, EOS, E_Base, ], 
    tags: [FReadIO, FWriteIO, FWriteDir, FReadDir], uses: [].}

Copies a file from source to dest preserving file permissions.

This is a wrapper proc around copyFile, getFilePermissions and setFilePermissions on non Windows platform. On windows this proc is just a wrapper for copyFile since that proc already copies attributes.

On non windows systems permissions are copied after the file itself has been copied, which won't happen atomically and could lead to a race condition. If ignorePermissionErrors is true, errors while reading/setting file attributes will be ignored, otherwise will raise OSError.

See source
proc inclFilePermissions(filename: string; permissions: set[TFilePermission]) {.
    rtl, extern: "nos$1", tags: [FReadDir, FWriteDir], raises: [EOS], uses: [].}
a convenience procedure for:
setFilePermissions(filename, getFilePermissions(filename)+permissions)
See source
proc exclFilePermissions(filename: string; permissions: set[TFilePermission]) {.
    rtl, extern: "nos$1", tags: [FReadDir, FWriteDir], raises: [EOS], uses: [].}
a convenience procedure for:
setFilePermissions(filename, getFilePermissions(filename)-permissions)
See source
proc getHomeDir(): string {.rtl, extern: "nos$1", tags: [FReadEnv], raises: [], 
                            uses: [].}

Returns the home directory of the current user.

This proc is wrapped by the expandTilde proc for the convenience of processing paths coming from user configuration files.

See source
proc getConfigDir(): string {.rtl, extern: "nos$1", tags: [FReadEnv], 
                              raises: [], uses: [].}
Returns the config directory of the current user for applications. See source
proc getTempDir(): string {.rtl, extern: "nos$1", tags: [FReadEnv], raises: [], 
                            uses: [].}
Returns the temporary directory of the current user for applications to save temporary files in. See source
proc paramStr(i: int): TaintedString {.tags: [FReadIO], raises: [EInvalidIndex], 
                                       uses: [].}
See source
proc paramCount(): int {.tags: [FReadIO], raises: [], uses: [].}
See source
proc commandLineParams(): seq[TaintedString] {.raises: [EInvalidIndex], 
    tags: [FReadIO], uses: [].}
See source
proc getAppFilename(): string {.rtl, extern: "nos$1", tags: [FReadIO], 
                                raises: [], uses: [].}

Returns the filename of the application's executable.

This procedure will resolve symlinks.

Note: This does not work reliably on BSD.

See source
proc getApplicationFilename(): string {.rtl, extern: "nos$1", deprecated, 
                                        raises: [], tags: [FReadIO], uses: [].}
Returns the filename of the application's executable. Deprecated since version 0.8.12: use getAppFilename instead. See source
proc getApplicationDir(): string {.rtl, extern: "nos$1", deprecated, raises: [], 
                                   tags: [FReadIO], uses: [].}
Returns the directory of the application's executable. Deprecated since version 0.8.12: use getAppDir instead. See source
proc getAppDir(): string {.rtl, extern: "nos$1", tags: [FReadIO], raises: [], 
                           uses: [].}
Returns the directory of the application's executable. Note: This does not work reliably on BSD. See source
proc sleep(milsecs: int) {.rtl, extern: "nos$1", tags: [FTime], raises: [], 
                           uses: [].}
sleeps milsecs milliseconds. See source
proc getFileSize(file: string): BiggestInt {.rtl, extern: "nos$1", 
    tags: [FReadIO], raises: [EOutOfMemory, EIO, EOS], uses: [].}
returns the file size of file. Can raise EOS. See source
proc findExe(exe: string): string {.tags: [FReadDir, FReadEnv], raises: [], 
                                    uses: [].}
Searches for exe in the current working directory and then in directories listed in the PATH environment variable. Returns "" if the exe cannot be found. On DOS-like platforms, exe is added an .exe file extension if it has no extension. See source
proc expandTilde(path: string): string {.raises: [], tags: [FReadEnv], uses: [].}

Expands a path starting with ~/ to a full path.

If path starts with the tilde character and is followed by / or \ this proc will return the reminder of the path appended to the result of the getHomeDir() proc, otherwise the input path will be returned without modification.

The behaviour of this proc is the same on the Windows platform despite not having this convention. Example:

let configFile = expandTilde("~" / "appname.cfg")
echo configFile
# --> C:\Users\amber\appname.cfg
See source
proc getFileInfo(handle: TFileHandle): FileInfo {.raises: [EOS], tags: [], 
    uses: [].}

Retrieves file information for the file object represented by the given handle.

If the information cannot be retrieved, such as when the file handle is invalid, an error will be thrown. Done: ID, Kind, Size, Permissions, Link Count

See source
proc getFileInfo(file: TFile): FileInfo {.raises: [EOS], tags: [], uses: [].}
See source
proc getFileInfo(path: string; followSymlink = true): FileInfo {.raises: [EOS], 
    tags: [], uses: [].}

Retrieves file information for the file object pointed to by path.

Due to intrinsic differences between operating systems, the information contained by the returned FileInfo structure will be slightly different across platforms, and in some cases, incomplete or inaccurate.

When followSymlink is true, symlinks are followed and the information retrieved is information related to the symlink's target. Otherwise, information on the symlink itself is retrieved.

If the information cannot be retrieved, such as when the path doesn't exist, or when permission restrictions prevent the program from retrieving file information, an error will be thrown.

See source

Iterators

iterator parentDirs(path: string; fromRoot = false; inclusive = true): string {.
    raises: [], tags: [], uses: [].}

Walks over all parent directories of a given path

If fromRoot is set, the traversal will start from the file system root diretory. If inclusive is set, the original argument will be included in the traversal.

Relative paths won't be expanded by this proc. Instead, it will traverse only the directories appearing in the relative path.

See source
iterator envPairs(): tuple[key, value: TaintedString] {.tags: [FReadEnv], 
    raises: [], uses: [].}
Iterate over all environments variables. In the first component of the tuple is the name of the current variable stored, in the second its value. See source
iterator walkFiles(pattern: string): string {.tags: [FReadDir], raises: [], 
    uses: [].}

Iterate over all the files that match the pattern. On POSIX this uses the glob call.

pattern is OS dependent, but at least the "*.ext" notation is supported.

See source
iterator walkDir(dir: string): tuple[kind: TPathComponent, path: string] {.
    tags: [FReadDir], raises: [], uses: [].}

walks over the directory dir and yields for each directory or file in dir. The component type and full path for each item is returned. Walking is not recursive. Example: This directory structure:

dirA / dirB / fileB1.txt
     / dirC
     / fileA1.txt
     / fileA2.txt

and this code:

for kind, path in walkDir("dirA"):
  echo(path)

produces this output (but not necessarily in this order!):

dirA/dirB
dirA/dirC
dirA/fileA1.txt
dirA/fileA2.txt

See source
iterator walkDirRec(dir: string; filter = {pcFile, pcDir}): string {.
    tags: [FReadDir], raises: [], uses: [].}

walks over the directory dir and yields for each file in dir. The full path for each file is returned. Warning: Modifying the directory structure while the iterator is traversing may result in undefined behavior!

Walking is recursive. filter controls the behaviour of the iterator:

filtermeaning
pcFileyield real files
pcLinkToFileyield symbolic links to files
pcDirfollow real directories
pcLinkToDirfollow symbolic links to directories
See source
Generated: 2014-04-21 09:48:43 UTC