本文簡要介紹ruby語言中 FileTest.world_readable?
的用法。
用法
world_readable?(file_name) → integer or nil
如果 file_name
可以被其他人讀取,則返回一個整數,表示 file_name
的文件權限位。否則返回nil
。位的含義取決於平台;在 Unix 係統上,請參閱 stat(2)
。
file_name
可以是 IO
對象。
File.world_readable?("/etc/passwd") #=> 420
m = File.world_readable?("/etc/passwd")
sprintf("%o", m) #=> "644"
相關用法
- Ruby FileTest.world_writable?用法及代碼示例
- Ruby FileTest.identical?用法及代碼示例
- Ruby FileTest.directory?用法及代碼示例
- Ruby File.identical?用法及代碼示例
- Ruby FileUtils.mkdir用法及代碼示例
- Ruby FileUtils.compare_file用法及代碼示例
- Ruby FileUtils.options_of用法及代碼示例
- Ruby File.dirname用法及代碼示例
- Ruby FileUtils.ln_s用法及代碼示例
- Ruby File.directory?用法及代碼示例
- Ruby FileUtils.install用法及代碼示例
- Ruby File.link用法及代碼示例
- Ruby FileUtils.chown_R用法及代碼示例
- Ruby File.expand_path用法及代碼示例
- Ruby FileUtils.cp_lr用法及代碼示例
- Ruby File.lstat用法及代碼示例
- Ruby File.umask用法及代碼示例
- Ruby FileUtils.rmdir用法及代碼示例
- Ruby File.absolute_path?用法及代碼示例
- Ruby FileUtils.rm_rf用法及代碼示例
- Ruby FileUtils.collect_method用法及代碼示例
- Ruby File.rename用法及代碼示例
- Ruby File.split用法及代碼示例
- Ruby FileUtils.commands用法及代碼示例
- Ruby FileUtils.mv用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 FileTest.world_readable?。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。