首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Net::FTP::MLSxEntry

Parent:Object

MLSxEntry表示MLST / MLSD响应中的条目。每个条目都有事实(例如大小,上次修改时间等)和路径名。

属性

factsR

pathnameR

公共类方法

new(facts, pathname) Show source

代码语言:javascript
复制
# File lib/net/ftp.rb, line 930
def initialize(facts, pathname)
  @facts = facts
  @pathname = pathname
end

公共实例方法

appendable?() Show source

如果可以将APPE命令应用于文件,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 966
def appendable?
  return facts["perm"].include?(?a)
end

creatable?() Show source

如果文件可能由STOU,STOR,APPE和RNTO在目录中创建,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 974
def creatable?
  return facts["perm"].include?(?c)
end

deletable?() Show source

如果文件或目录可能被DELE / RMD删除,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 981
def deletable?
  return facts["perm"].include?(?d)
end

directory?() Show source

如果条目是目录(即,类型fact的值是dir,cdir或pdir),则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 955
def directory?
  if /\A[cp]?dir\z/.match(facts["type"])
    return true
  else
    return false
  end
end

directory_makable?() Show source

如果可以使用MKD命令在目录中创建一个新目录,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 1011
def directory_makable?
  return facts["perm"].include?(?m)
end

enterable?() Show source

如果目录可能由CWD / CDUP输入,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 988
def enterable?
  return facts["perm"].include?(?e)
end

file?() Show source

如果条目是文件(例如,类型fact是文件的值),则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 947
def file?
  return facts["type"] == "file"
end

listable?() Show source

如果将列表命令LIST,NLST和MLSD应用于目录,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 1003
def listable?
  return facts["perm"].include?(?l)
end

purgeable?() Show source

如果目录中的对象可能被删除,或者目录可能被清除,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 1019
def purgeable?
  return facts["perm"].include?(?p)
end

readable?() Show source

如果可以将RETR命令应用于文件,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 1026
def readable?
  return facts["perm"].include?(?r)
end

renamable?() Show source

如果文件或目录可能被RNFR重命名,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 995
def renamable?
  return facts["perm"].include?(?f)
end

writable?() Show source

如果可以将STOR命令应用于文件,则返回true。

代码语言:javascript
复制
# File lib/net/ftp.rb, line 1033
def writable?
  return facts["perm"].include?(?w)
end

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com