るりまサーチ

最速Rubyリファレンスマニュアル検索!
60件ヒット [1-60件を表示] (0.107秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

モジュール

キーワード

検索結果

FileUtils.#chmod(mode, list, options = {}) -> Array (18344.0)

ファイル list のパーミッションを mode に変更します。

...ファイル list のパーミッションを mode に変更します。

@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します。

@param list ファイルのリストを指定します。 対象のファイルが一つの場合は文...
...します。

@param options :noop と :verbose が指定可能です。
c:FileUtils#options

@return list を配列として返します。

//emlist[][ruby]{
# Absolute mode
r
equire 'fileutils'
FileUtils.chmod(0644, %w(my.rb your.rb his.rb her.rb))
FileUtils.chmod(0755, 'somecommand...
...')
FileUtils.chmod(0755, '/usr/bin/ruby', verbose: true)
# Symbolic mode
r
equire 'fileutils'
FileUtils.chmod("u=wr,go=rr", %w(my.rb your.rb his.rb her.rb))
FileUtils.chmod("u=wrx,go=rx", 'somecommand')
FileUtils.chmod("u=wrx,go=rx", '/usr/bin/ruby', verbose: true)
//}

symbolic mode では以下の...

FileUtils.#chmod_R(mode, list, options = {}) -> Array (12321.0)

ファイル list のパーミッションを再帰的に mode へ変更します。

...list のパーミッションを再帰的に mode へ変更します。

@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します(FileUtils.#chmod 参照)。

@param list ファイルのリストを指定します。対象のファイルが...
...二つ以上指定する場合は配列で指定します。

@param options :noop と :verbose が指定可能です。
c:FileUtils#options

@return list を配列として返します。

//emlist[][ruby]{
r
equire 'fileutils'
FileUtils.chmod_R(0700, '/tmp/removing')
//}...

FileTest.#executable_real?(file) -> bool (6213.0)

ファイルがカレントプロセスの実ユーザか実グループで実行できる時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...lse を返します。

@param file ファイル名を表す文字列を指定します。

//emlist[例][ruby]{
IO.write("empty.txt", "")
File.chmod(0744, "empty.txt")
FileTest.executable_real?("empty.txt") # => true
File.chmod(0644, "empty.txt")
FileTest.executable_real?("empty.txt") # =...

FileTest.#readable?(file) -> bool (6213.0)

ファイルがカレントプロセスにより読み込み可能な時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...には false を返します。

@param file ファイル名を表す文字列を指定します。

//emlist[例][ruby]{
IO.write("testfile", "")
File.chmod(0644, "testfile")
FileTest.readable?("testfile") # => true
File.chmod(0200, "testfile")
FileTest.readable?("testfile") # => false
//...

FileTest.#writable?(file) -> bool (6213.0)

ファイルがカレントプロセスにより書き込み可能である時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...は false を返します。

@param file ファイル名を表す文字列を指定します。

//emlist[例][ruby]{
IO.write("testfile", "test")
File.chmod(0600, "testfile")
FileTest.writable?("testfile") # => true
File.chmod(0400, "testfile")
FileTest.writable?("testfile") # => false
/...

絞り込み条件を変える