Ruby require each file




















Returns whether the file at the given path is readable by the effective user and group of the current process. Returns whether the file at the given path is readable by the real user and group of the current process.

Returns the File::Stat object for the file at the given path. Returns whether the file at the given path is writable by the effective user and group of the current process. Returns whether the file at the given path is writable by the real user and group of the current process. Returns the File::Stat object for the last symbolic link in the path for self. Returns nil if there is no file at the given path, or if that file is empty; otherwise returns the file size bytes.

For each given file path, sets the access time and modification time of the last symbolic link in the path. Converts a pathname to an absolute pathname. Returns the last access time for the named file as a Time object. Actual effects are operating system dependent see the beginning of this section. On Unix systems, see chmod 2 for details.

Returns the number of files processed. Changes the owner and group of the named file s to the given numeric owner and group id's. Only a process with superuser privileges may change the owner of a file. The current owner of a file may change the file's group to any group to which the owner belongs. A nil or -1 owner or group id is ignored. Returns the change time for the named file the time at which directory information about the file was changed, not the file itself.

Deletes the named files, returning the number of names passed as arguments. Raises an exception on any error. Since the underlying implementation relies on the unlink 2 system call, the type of exception raised depends on its error type see linux. Returns true if the named file is a directory, or a symlink that points at a directory, and false otherwise. Returns true if the named file is executable by the effective user and group id of this process.

See eaccess 3. Windows does not support execute permissions separately from read permissions. On Windows, a file is only considered executable if it ends in.

Returns true if the named file is executable by the real user and group id of this process. See access 3. A more complex example which also resolves parent directory is as follows. Returns the extension the portion of file name in path starting from the last period. If path is a dotfile, or starts with a period, then the starting dot is not dealt with the start of the extension.

An empty string will also be returned when the period is the last character in path. If the file argument is a symbolic link, it will resolve the symbolic link and use the file referenced by the link. Returns true if path matches against pattern. The pattern is not a regular expression; instead it follows rules similar to shell filename globbing.

It may contain the following metacharacters:. Matches any file. Can be restricted by other values in the glob. Matches any one character in set. Behaves like a Regexp union? The same glob pattern and flags are used by Dir::glob.

Returns true if the named file exists and the effective group id of the calling process is the owner of the file. Returns false on Windows. Equivalent to File::chmod , but does not follow symbolic links so it will change the permissions associated with the link, not the file referenced by the link. Often not available. Equivalent to File::chown , but does not follow symbolic links so it will change the owner associated with the link, not the file referenced by the link.

Returns number of files in the argument list. Creates a new name for an existing file using a hard link. Not available on all platforms. Same as File::stat , but does not follow the last symbolic link. Instead, reports on the link itself. Sets the access and modification times of each named file to the first two arguments. If a file is a symlink, this method acts upon the link itself as opposed to its referent; for the inverse behavior, see File. Returns the number of file names in the argument list.

Returns the modification time for the named file as a Time object. 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. It returns true if the pathname begins with a slash. Returns the last access time for the file. See File. Returns the last component of the path. Returns all the bytes from the file, or the first N if specified. Writes contents to the file, opening it in binary mode.

See FileTest. Changes file permissions. Change owner and group of the file. See realpath. Returns the last change time, using directory information, not the file itself.

Returns all but the last component of the path. 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.

Iterates over each component of the path. Returns an Enumerator if no block was given. Iterates over each line in the file and yields a String object for each. Tests the file is empty. See Dir empty? Returns the absolute path for the file.

Returns an Enumerator if no block is given. See Find. Return true if the receiver matches the given pattern. Freezes this Pathname. See Object. Pathname "ruby This method uses the base keyword argument of Dir. Same as chmod , but does not follow symbolic links. Same as chown , but does not follow symbolic links. Creates a hard link at pathname. Creates a symbolic link. Create the referenced directory. See Dir. See FileUtils. Returns true if self points to a mountpoint. Returns the last modified time of the file.

Opens the file for reading or writing. Curtis Moxam Curtis Moxam 39 6 6 bronze badges. JosephA91 JosephA91 92 9 9 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.

Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked Related Hot Network Questions. Question feed.



0コメント

  • 1000 / 1000