Ruby doc file class
If a file is a symlink, this method acts upon its referent rather than the link itself; for the inverse behavior see File.
Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat 2. Returns true if the named file is writable by the effective user and group id of this process.
Returns true if the named file is writable by the real user and group id of this process. Returns the last access time a Time object for file , or epoch if file has not been accessed. Actual effects are platform dependent; on Unix systems, see chmod 2 for details. Follows symbolic links. Also see File lchmod. Changes the owner and group of file to the given numeric owner and group id's. See also File lchown. Returns the change time for file that is, the time directory information about the file was changed, not the file itself.
Same as IO stat , but does not follow the last symbolic link. The pathname may not point to the file corresponding to file.
For instance, the pathname becomes void when the file has been moved or deleted. Truncates file to at most integer bytes. The file must be opened for writing. Home Core 2. Home Classes Methods. In Files dir. Parent IO. Files grammar.
File A File is an abstraction of any file object accessible by the program and is closely associated with class IO. Returns the birth time for the named file.
Returns true if the named file is a block device. Returns true if the named file is a character device. See also Dir::rmdir. Returns true if the named file exists and has a zero size. Return true if the named file exists. Deprecated method. Don't use. Returns true if the named file exists and is a regular file. To match hidden files that start with a. Matches any one character. Opens the file named by filename according to the given mode and returns a new File object.
See IO. If a file is being created, permission bits may be given in perm. These mode and permission bits are platform dependent; on Unix systems, see open 2 and chmod 2 man pages for details.
The new File object is buffered mode or non-sync mode , unless filename is a tty. With no associated block, File. If the optional code block is given, it will be passed the opened file as an argument and the File object will automatically be closed when the block terminates. The value of the block will be returned from File. If a file is being created, its initial permissions may be set using the perm parameter.
See File. Returns true if the named file exists and the effective used id of the calling process is the owner of the file. Returns true if the named file is readable by the effective user and group id of this process. Returns true if the named file is readable by the real user and group id of this process.
Returns the real absolute pathname of pathname in the actual filesystem. The real pathname doesn't contain symlinks or useless dots. Returns the real absolute pathname of pathname in the actual filesystem not containing symlinks or useless dots. Renames the given file to the new name.
Raises a SystemCallError if the file cannot be renamed. Splits the given string into a directory and a file component and returns them in a two-element array. See also File::dirname and File::basename. Returns a File::Stat object for the named file see File::Stat. Raises a NotImplemented exception on platforms that do not support symbolic links. Returns the current umask value for this process. If the optional argument is given, set the umask to that value and return the previous value.
Umask values are subtracted from the default permissions, so a umask of would make a file read-only for everyone. If a file is a symlink, this method acts upon its referent rather than the link itself; for the inverse behavior see File.
Returns nil otherwise. The meaning of the bits is platform dependent; on Unix systems, see stat 2. Returns true if the named file is writable by the effective user and group id of this process. Returns true if the named file is writable by the real user and group id of this process. Returns the last access time a Time object for file , or epoch if file has not been accessed. If the platform doesn't have birthtime, raises NotImplementedError.
Actual effects are platform dependent; on Unix systems, see chmod 2 for details. Follows symbolic links. Also see File lchmod. Changes the owner and group of file to the given numeric owner and group id's. See also File lchown. Returns the change time for file that is, the time directory information about the file was changed, not the file itself.
Same as IO stat , but does not follow the last symbolic link. The pathname may not point to the file corresponding to file.
For instance, the pathname becomes void when the file has been moved or deleted. Truncates file to at most integer bytes. The file must be opened for writing. Hack your world. Changes the owner and group of file to the given numeric owner and group id's. See also File lchown. Returns the change time for file that is, the time directory information about the file was changed, not the file itself. Same as IO stat , but does not follow the last symbolic link.
Truncates file to at most integer bytes. The file must be opened for writing. Home Core 1. Home Classes Methods. In Files dir. Parent IO. Methods ::atime ::basename ::blockdev? File A File is an abstraction of any file object accessible by the program and is closely associated with class IO File includes the methods of module FileTest as class methods, allowing you to write for example File.
Returns the last access time for the named file as a Time object. Returns true if the named file is a block device.
Returns true if the named file is a character device. Returns true if the named file is a directory, false otherwise. Returns true if the named file is executable by the real user id of this process.
Return true if the named file exists. Returns the extension the portion of file name in path after the period. Returns true if the named file exists and is a regular file. Matches any one character. Returns true if the named files are identical. Returns the modification time for the named file as a Time object. Returns true if the named file is a pipe. Files History. Class Classes in Ruby are first-class objectseach is an instance of class Class. Typically, you create a new class by using: class Name some code describing the class behavior end When a new class is created, an object of type Class is initialized and assigned to a global constant Name in this case.
Returns the superclass of class , or nil. Private Instance Methods inherited subclass click to toggle source. Callback invoked whenever a subclass of the current class is created.
0コメント