W3cubDocs

/Ruby 3

class Net::FTP::MLSxEntry

Parent:
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.

Attributes

facts[R]
pathname[R]

Public Class Methods

new(facts, pathname) Show source
# File lib/net/ftp.rb, line 933
def initialize(facts, pathname)
  @facts = facts
  @pathname = pathname
end

Public Instance Methods

appendable?() Show source
# File lib/net/ftp.rb, line 969
def appendable?
  return facts["perm"].include?(?a)
end

Returns true if the APPE command may be applied to the file.

creatable?() Show source
# File lib/net/ftp.rb, line 977
def creatable?
  return facts["perm"].include?(?c)
end

Returns true if files may be created in the directory by STOU, STOR, APPE, and RNTO.

deletable?() Show source
# File lib/net/ftp.rb, line 984
def deletable?
  return facts["perm"].include?(?d)
end

Returns true if the file or directory may be deleted by DELE/RMD.

directory?() Show source
# File lib/net/ftp.rb, line 958
def directory?
  if /\A[cp]?dir\z/.match(facts["type"])
    return true
  else
    return false
  end
end

Returns true if the entry is a directory (i.e., the value of the type fact is dir, cdir, or pdir).

directory_makable?() Show source
# File lib/net/ftp.rb, line 1014
def directory_makable?
  return facts["perm"].include?(?m)
end

Returns true if the MKD command may be used to create a new directory within the directory.

enterable?() Show source
# File lib/net/ftp.rb, line 991
def enterable?
  return facts["perm"].include?(?e)
end

Returns true if the directory may be entered by CWD/CDUP.

file?() Show source
# File lib/net/ftp.rb, line 950
def file?
  return facts["type"] == "file"
end

Returns true if the entry is a file (i.e., the value of the type fact is file).

listable?() Show source
# File lib/net/ftp.rb, line 1006
def listable?
  return facts["perm"].include?(?l)
end

Returns true if the listing commands, LIST, NLST, and MLSD are applied to the directory.

purgeable?() Show source
# File lib/net/ftp.rb, line 1022
def purgeable?
  return facts["perm"].include?(?p)
end

Returns true if the objects in the directory may be deleted, or the directory may be purged.

readable?() Show source
# File lib/net/ftp.rb, line 1029
def readable?
  return facts["perm"].include?(?r)
end

Returns true if the RETR command may be applied to the file.

renamable?() Show source
# File lib/net/ftp.rb, line 998
def renamable?
  return facts["perm"].include?(?f)
end

Returns true if the file or directory may be renamed by RNFR.

writable?() Show source
# File lib/net/ftp.rb, line 1036
def writable?
  return facts["perm"].include?(?w)
end

Returns true if the STOR command may be applied to the file.

Ruby Core © 1993–2020 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.