Class: Net::FTP::MLSxEntry (Ruby 2.7.2)
Description: Class : Net::FTP::MLSxEntry - Ruby 2.7.2

### Home Classes Methods

### In Files

- net/ftp.rb

### Parent

Object

### Methods

- ::new
- #appendable?
- #creatable?
- #deletable?
- #directory?
- #directory_makable?
- #enterable?
- #file?
- #listable?
- #purgeable?
- #readable?
- #renamable?
- #writable?

### Class/Module Index

Quicksearch

- Net
- Net::FTP
- Net::FTP::MLSxEntry
- Net::FTP::OpenSSL
- Net::FTP::OpenSSL::SSL

No matching classes.

# Net::FTP::MLSxEntry

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) click to toggle source

                   # File net/ftp.rb, line 932
    def initialize(facts, pathname)
      @facts = facts
      @pathname = pathname
    end

### Public Instance Methods

appendable?() click to toggle source

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

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

creatable?() click to toggle source

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

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

deletable?() click to toggle source

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

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

directory?() click to toggle source

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 957
    def directory?
      if /\A[cp]?dir\z/.match(facts["type"])
        return true
      else
        return false
      end
    end

directory_makable?() click to toggle source

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

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

enterable?() click to toggle source

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

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

file?() click to toggle source

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

                   # File net/ftp.rb, line 949
    def file?
      return facts["type"] == "file"
    end

listable?() click to toggle source

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

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

purgeable?() click to toggle source

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

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

readable?() click to toggle source

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

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

renamable?() click to toggle source

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

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

writable?() click to toggle source

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

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