chmod

pathname.chmod â integer Instance Public methods Changes file permissions. See File.chmod.

chown

pathname.chown â integer Instance Public methods Change owner and group of the file. See File.chown.

cleanpath

cleanpath(consider_symlink=false) Instance Public methods Returns clean pathname of self with consecutive slashes and useless dots removed. The filesystem is not accessed. If consider_symlink is true, then a more conservative algorithm is used to avoid breaking symbolic linkages. This may retain more .. entries than absolutely necessary, but without accessing the filesystem, this can't be avoided. See #realpath.

ctime

pathname.ctime â time Instance Public methods Returns the last change time, using directory information, not the file itself. See File.ctime.

delete

delete() Instance Public methods Removes a file or directory, using File.unlink if self is a file, or Dir.unlink as necessary.

descend

descend() Instance Public methods Iterates over and yields a new Pathname object for each element in the given path in descending order. Pathname.new('/path/to/some/file.rb').descend {|v| p v} #<Pathname:/> #<Pathname:/path> #<Pathname:/path/to> #<Pathname:/path/to/some> #<Pathname:/path/to/some/file.rb> Pathname.new('path/to/some/file.rb').descend {|v| p v} #<Pathname:path> #<Pathname:path/to> #<Pathname:path/to

directory?

directory?() Instance Public methods See FileTest#directory?.

dirname

dirname() Instance Public methods Returns all but the last component of the path. See File.dirname.

each_child

each_child(with_directory=true, &b) Instance Public methods Iterates over the children of the directory (files and subdirectories, not recursive). It yields Pathname object for each child. By default, the yielded pathnames will have enough information to access the files. If you set with_directory to false, then the returned pathnames will contain the filename only. Pathname("/usr/local").each_child {|f| p f } #=> #<Pathname:/usr/local/share> # #<Pathname:/usr/loc

each_entry

each_entry() Instance Public methods Iterates over the entries (files and subdirectories) in the directory, yielding a Pathname object for each entry.