fnmatch

File.fnmatch( pattern, path, [flags] ) â (true or false)File.fnmatch?( pattern, path, [flags] ) â (true or false) Class Public methods 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. * will match all files; c* will match all files beginning with c; *c will match all files

fnmatch?

File.fnmatch?( pattern, path, [flags] ) â (true or false) Class Public methods 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. * will match all files; c* will match all files beginning with c; *c will match all files ending with c; and *c* will match all files that have c

ftype

File.ftype(file_name) â string Class Public methods Identifies the type of the named file; the return string is one of âfile'', âdirectory'', âcharacterSpecial'', âblockSpecial'', âfifo'', âlink'', âsocket'', or âunknown''. File.ftype("testfile") #=> "file" File.ftype("/dev/tty") #=> "characterSpecial" File.ftype("/tmp/.X11-unix/X0") #=> "socket"

grpowned?

File.grpowned?(file_name) â true or false Class Public methods 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. file_name can be an IO object.

identical?

File.identical?(file_1, file_2) â true or false Class Public methods Returns true if the named files are identical. file_1 and file_2 can be an IO object. open("a", "w") {} p File.identical?("a", "a") #=> true p File.identical?("a", "./a") #=> true File.link("a", "b") p File.identical?("a", "b") #=> true File.symlink("a", "c") p File.identical?("a", "c") #=> true open("d", "w") {} p File.identical?("a", "d") #=> false

join

File.join(string, ...) â path Class Public methods Returns a new string formed by joining the strings using File::SEPARATOR. File.join("usr", "mail", "gumby") #=> "usr/mail/gumby"

lchmod

File.lchmod(mode_int, file_name, ...) â integer Class Public methods 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.

lchown

File.lchown(owner_int, group_int, file_name,..) â integer Class Public methods 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). Often not available. Returns number of files in the argument list.

link

File.link(old_name, new_name) â 0 Class Public methods Creates a new name for an existing file using a hard link. Will not overwrite new_name if it already exists (raising a subclass of SystemCallError). Not available on all platforms. File.link("testfile", ".testfile") #=> 0 IO.readlines(".testfile")[0] #=> "This is line one\n"

lstat

File.lstat(file_name) â stat Class Public methods Same as File::stat, but does not follow the last symbolic link. Instead, reports on the link itself. File.symlink("testfile", "link2test") #=> 0 File.stat("testfile").size #=> 66 File.lstat("link2test").size #=> 8 File.stat("link2test").size #=> 66