別のキーワード
キーワード
- cd (24)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chown (12)
-
chown
_ R (12) - cmp (12)
-
compare
_ file (12) - copy (12)
- cp (12)
-
cp
_ lr (7) -
cp
_ r (12) - identical? (12)
- install (12)
- link (12)
- ln (12)
-
ln
_ s (12) - makedirs (12)
- mkdir (12)
-
mkdir
_ p (12) - mkpath (12)
- move (12)
- mv (12)
- remove (12)
-
remove
_ entry (12) - rm (12)
-
rm
_ r (12) - rmdir (12)
- symlink (12)
- touch (12)
- uptodate? (12)
検索結果
先頭5件
- FileUtils
. # touch(list , options = {}) -> () - FileUtils
. # uptodate?(newer , older _ list , options = nil) -> bool - FileUtils
. # cp _ lr(src , dest , noop: nil , verbose: nil , dereference _ root: true , remove _ destination: false) - FileUtils
. # chown(user , group , list , options = {}) -> Array - FileUtils
. # chown _ R(user , group , list , options = {}) -> Array
-
FileUtils
. # touch(list , options = {}) -> () (6116.0) -
list で指定されたファイルの最終変更時刻 (mtime) と アクセス時刻 (atime) を変更します。
...場合は配列で指定します。
@param options :mtime, :nocreate, :noop, :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.touch('timestamp')
FileUtils.touch('timestamp', mtime: Time.now)
FileUtils.touch(Dir.glob('*.c'))
//}... -
FileUtils
. # uptodate?(newer , older _ list , options = nil) -> bool (6116.0) -
newer が、older_list に含まれるすべてのファイルより新しいとき真。 存在しないファイルは無限に古いとみなされます。
...@param options どのようなオプションも指定することはできません。
@raise ArgumentError options にオプションを指定した場合に発生します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.uptodate?('hello.o', ['hello.c', 'hello.h']) or system('make')
//}... -
FileUtils
. # cp _ lr(src , dest , noop: nil , verbose: nil , dereference _ root: true , remove _ destination: false) (3200.0) -
src へのハードリンク dest を作成します。 src がディレクトリの場合、再帰的にリンクします。 dest がディレクトリの場合、src へのハードリンク dest/src を作成します。
...クトリです。
@param options :noop, :verbose, :dereference_root, :remove_destination が指定できます。
c:FileUtils#options
@raise ArgumentError dest が src に含まれる場合に発生します。
@raise Errno::EEXIST src が一つで dest がすでに存在しディ......を site_ruby にインストールする例][ruby]{
require 'fileutils'
FileUtils.rm_r site_ruby + '/mylib', force: true
FileUtils.cp_lr 'lib/', site_ruby + '/mylib'
//}
//emlist[様々なファイルを対象ディレクトリにリンクする例][ruby]{
require 'fileutils'
FileUtils.cp_lr %w(ma......il.rb field.rb debug/), site_ruby + '/tmail'
FileUtils.cp_lr Dir.glob('*.rb'), '/home/aamine/lib/ruby', noop: true, verbose: true
//}
//emlist[内容をリンクする例][ruby]{
require 'fileutils'
# ディレクトリそのものではなく、ディレクトリの内容をリンクしたい場... -
FileUtils
. # chown(user , group , list , options = {}) -> Array (3128.0) -
ファイル list の所有ユーザと所有グループを user と group に変更します。
...ーザと所有グループを user と group に変更します。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しません。
@param group グループ名か gid を指......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 (3128.0) -
list 以下のファイルの所有ユーザと所有グループを user と group へ再帰的に変更します。
...と所有グループを
user と group へ再帰的に変更します。
user, group に nil または -1 を渡すとその項目は変更しません。
@param user ユーザー名か uid を指定します。nil/-1 を指定すると変更しません。
@param group グループ名か gid......。
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',......'/var/www/htdocs'
FileUtils.chown_R 'cvs', 'cvs', '/var/cvs', verbose: true
//}... -
FileUtils
. # cp _ r(src , dest , options = {}) -> () (3088.0) -
src を dest にコピーします。src がディレクトリであったら再帰的に コピーします。その際 dest がディレクトリなら dest/src にコピーします。
...c:FileUtils#options
//emlist[][ruby]{
# installing ruby library "mylib" under the site_ruby
require 'fileutils'
FileUtils.rm_r(site_ruby + '/mylib', force: true)
FileUtils.cp_r('lib/', site_ruby + '/mylib')
# other sample
require 'fileutils'
FileUtils.cp_r(%w(mail.rb field.rb debug/), site_ruby +......'/tmail')
FileUtils.cp_r(Dir.glob('*.rb'), '/home/taro/lib/ruby',
noop: true, verbose: true)
//}... -
FileUtils
. # chmod(mode , list , options = {}) -> Array (3064.0) -
ファイル list のパーミッションを mode に変更します。
...ファイル list のパーミッションを mode に変更します。
@param mode パーミッションを8進数(absolute mode)か文字列(symbolic
mode)で指定します。
@param list ファイルのリストを指定します。 対象のファイルが一つの場合は文......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 'fileut......ils'
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
. # install(src , dest , options = {}) -> () (3064.0) -
src と dest の内容が違うときだけ src を dest にコピーします。
...m options :preserve, :noop, :verbose, :mode が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.install('ruby', '/usr/local/bin/ruby', mode: 0755, verbose: true)
FileUtils.install('lib.rb', '/usr/local/lib/ruby/site_ruby', verbose: true)
//}......rve, :noop, :verbose, :mode, :owner, :group が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.install('ruby', '/usr/local/bin/ruby', mode: 0755, verbose: true)
FileUtils.install('lib.rb', '/usr/local/lib/ruby/site_ruby', verbose: true)
//}... -
FileUtils
. # copy(src , dest , options = {}) -> () (3040.0) -
ファイル src を dest にコピーします。
...c:FileUtils#options
@raise Errno::ENOTDIR src が複数のファイルかつ、dest がディレクトリでない場合に発生します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cp 'eval.c', 'eval.c.org'
FileUtils.cp(['cgi.rb', 'complex.rb', 'date.rb'], '/usr/lib/ruby/1.8')
FileUtils.c......p(%w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.8', verbose: true)
//}...