method

ftype

v2_2_9 - Show latest stable - Class: File
ftype(p1)
public

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"