|
The Dir class contains methods for interacting with directories: getting lists of files, changing the working directory, and retrieving the working directory among others. Class Methodschdir(path) [native]Changes the current working directory to path. Dir.chdir('/') => undefined
Dir.chdir('/does/not/exist'} => _exception thrown_chroot(path) [native]Changes the root directory (for an aptly privileged process) to path. Dir.chroot('/tmp') => undefined
Dir.chroot('/does/not/exist') => _exception thrown_entries(path) [native]Returns an array of items in path. Dir.entries('/System') => [., .., Library]
Dir.entries('/does/not/exist') => _exception thrown_foreach(path, callback) [js]Calls callback for each item in path. Dir.entries('/System', function(i) { print(i) }) => undefinedmkdir(path) [native]Creates a new directory named path. Dir.mkdir('/tmp/dir') => undefinedpwd() [native]Returns the current working directory. Dir.pwd() => '/Users/youruser' rmdir(path) [native]Removes path using the rmdir system call. Dir.rmdir('/tmp/somedir') => undefined
Dir.rmdir('/') => _exception thrown_tmpdir() [native]Returns the systems temporary directory (value stored in the TMP_DIR environment variable). Dir.tmpdir() => /var/folders/eo/eo3EQOcj47Kt+TI/-Tmp-/ Instance MethodsNone implemented.
|