モジュール
- FileUtils (583)
キーワード
- METHODS (11)
-
OPT
_ TABLE (11) - cd (22)
- chdir (22)
- chmod (11)
-
chmod
_ R (11) - chown (11)
-
chown
_ R (11) - cmp (11)
-
collect
_ method (11) - commands (11)
-
compare
_ file (11) -
compare
_ stream (11) - copy (11)
-
copy
_ entry (11) -
copy
_ file (11) -
copy
_ stream (11) - cp (11)
-
cp
_ r (11) - getwd (11)
-
have
_ option? (11) - identical? (11)
- install (11)
- link (11)
- ln (11)
-
ln
_ s (11) -
ln
_ sf (11) - makedirs (11)
- mkdir (11)
-
mkdir
_ p (11) - mkpath (11)
- move (11)
- mv (11)
- pwd (11)
- remove (11)
-
remove
_ dir (11) -
remove
_ entry (11) -
remove
_ entry _ secure (11) -
remove
_ file (11) - rm (11)
-
rm
_ f (11) -
rm
_ r (11) -
rm
_ rf (11) - rmdir (11)
- rmtree (11)
-
safe
_ unlink (11) - symlink (11)
- touch (11)
- uptodate? (11)
検索結果
先頭5件
-
FileUtils
. # remove _ entry _ secure(path , force = false) -> () (126.0) -
ファイル path を削除します。path がディレクトリなら再帰的に削除します。
...ら再帰的に削除します。
FileUtils.#rm_r および FileUtils.#remove_entry には
TOCTTOU (time-of-check to time-of-use)脆弱性が存在します。
このメソッドはそれを防ぐために新設されました。
FileUtils.#rm_r および FileUtils.#remove_entry は以下の条件... -
FileUtils
. # chown(user , group , list , options = {}) -> Array (108.0) -
ファイル list の所有ユーザと所有グループを user と group に変更します。
...ます。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しません。
@param group グループ名か gid を指定します。nil/-1 を指定すると変更しません......ptions :noop と :verbose が指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
//}... -
FileUtils
. # chown _ R(user , group , list , options = {}) -> Array (108.0) -
list 以下のファイルの所有ユーザと所有グループを user と group へ再帰的に変更します。
...ます。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しません。
@param group グループ名か gid を指定します。nil/-1 を指定すると変更しません......。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chown 'root', 'staff', '/usr/local/bin/ruby'
FileUtils.chown nil, 'bin', Dir.glob('/usr/bin/*'), verbose: true
require 'fileutils'
FileUtils.chown_R 'www', 'www',... -
FileUtils
. # cd(dir , options = {}) -> 0 (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) -> nil (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) {|dir| . . . . } -> nil (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # cd(dir , options = {}) {|dir| . . . . } -> object (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) -> 0 (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) -> nil (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> nil (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> object (102.0) -
プロセスのカレントディレクトリを dir に変更します。
...ック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chmod(mode , list , options = {}) -> Array (102.0) -
ファイル list のパーミッションを mode に変更します。
...指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
# Absolute mode
require '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
require '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 では以下の指定を 操作対象 演算子 権限 の順番で......のファイルと同じグループにも属していない)を指定するマスク
演算子。
* "+": 以降で指定した権限を追加
* "-" 以降で指定した権限を削除
* "=" 以降で指定した権限を指定
権限(複数指定可)。
* "w": 書き込み権限
* "r":... -
FileUtils
. # chmod _ R(mode , list , options = {}) -> Array (102.0) -
ファイル list のパーミッションを再帰的に mode へ変更します。
...mode へ変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します(FileUtils.#chmod 参照)。
@param list ファイルのリストを指定します。対象のファイルが一つの場合は文字列でも指定可能......二つ以上指定する場合は配列で指定します。
@param options :noop と :verbose が指定可能です。
c:FileUtils#options
@return list を配列として返します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.chmod_R(0700, '/tmp/removing')
//}... -
FileUtils
. # cmp(file _ a , file _ b) -> bool (102.0) -
ファイル file_a と file_b の内容が同じなら真を返します。
...ファイル file_a と file_b の内容が同じなら真を返します。
@param file_a ファイル名。
@param file_b ファイル名。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cmp('somefile', 'somefile') #=> true
FileUtils.cmp('/dev/null', '/dev/urandom') #=> false
//}...