Support for the Ruby 2.4 series has ended. See here for reference.
Object
MLSxEntry
represents an entry in responses of MLST/MLSD. Each entry has the facts (e.g., size, last modification time, etc.) and the pathname.
Returns true
if the APPE command may be applied to the file.
# File net/ftp.rb, line 967 def appendable? return facts["perm"].include?(?a) end
Returns true
if files may be created in the directory by STOU, STOR, APPE, and RNTO.
# File net/ftp.rb, line 975 def creatable? return facts["perm"].include?(?c) end
Returns true
if the file or directory may be deleted by DELE/RMD.
# File net/ftp.rb, line 982 def deletable? return facts["perm"].include?(?d) end
Returns true
if the entry is a directory (i.e., the value of the type fact is dir, cdir, or pdir).
# File net/ftp.rb, line 956 def directory? if /\A[cp]?dir\z/.match(facts["type"]) return true else return false end end
Returns true
if the MKD command may be used to create a new directory within the directory.
# File net/ftp.rb, line 1012 def directory_makable? return facts["perm"].include?(?m) end
Returns true
if the directory may be entered by CWD/CDUP.
# File net/ftp.rb, line 989 def enterable? return facts["perm"].include?(?e) end
Returns true
if the entry is a file (i.e., the value of the type fact is file).
# File net/ftp.rb, line 948 def file? return facts["type"] == "file" end
Returns true
if the listing commands, LIST, NLST, and MLSD are applied to the directory.
# File net/ftp.rb, line 1004 def listable? return facts["perm"].include?(?l) end
Returns true
if the objects in the directory may be deleted, or the directory may be purged.
# File net/ftp.rb, line 1020 def purgeable? return facts["perm"].include?(?p) end
Returns true
if the RETR command may be applied to the file.
# File net/ftp.rb, line 1027 def readable? return facts["perm"].include?(?r) end