るりまサーチ

最速Rubyリファレンスマニュアル検索!
883件ヒット [501-600件を表示] (0.035秒)
トップページ > クラス:File[x] > クエリ:File[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file open
  4. base file
  5. file size

ライブラリ

キーワード

検索結果

<< < ... 4 5 6 7 8 ... > >>

File.truncate(path, length) -> 0 (21013.0)

path で指定されたファイルのサイズを最大 length バイト にします。

...す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File
.truncate("testfile", 5) # => 0
File
.size("testfile") # => 5
//}...

File.umask(umask) -> Integer (21013.0)

umask を変更します。変更前の umask の値を返します。

...umask を変更します。変更前の umask の値を返します。

@param umask 設定したい umask の値を整数で指定します。

//emlist[例][ruby]{
File
.umask(0006) # => 18
File
.umask # => 6
//}

@see umask(2)...

File#chmod(mode) -> 0 (21007.0)

ファイルのモードを指定された mode に変更します。

...EXXX が発生し
ます。

@param mode chmod(2) と同様に整数で指定します。

@raise IOError 自身が close されている場合に発生します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
f = File.new("out", "w");
f.chmod(0644) #=> 0
//}...

File#truncate(length) -> 0 (21007.0)

ファイルのサイズを最大 length バイトにします。

...書き込み用にオープンされていなければ発生します。

@raise Errno::EXXX サイズの変更に失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File
.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5
end
//}...

File.link(old, new) -> 0 (21007.0)

old を指す new という名前のハードリンクを 生成します。old はすでに存在している必要があります。 ハードリンクに成功した場合は 0 を返します。

...を指定します。

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

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
File
.link("testfile", "testlink") # => 0
IO.read("testlink") # => "test"
//}...

絞り込み条件を変える

File.symlink(old, new) -> 0 (21007.0)

old への new という名前のシンボリックリンクを生成します。

...発生します。

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

@param new シンボリックリンクを表す文字列を指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
File
.symlink("testfile", "testlink") # => 0
//}...

File.world_readable?(path) -> Integer | nil (21007.0)

path が全てのユーザから読めるならばそのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。

...場合は nil を返します。

整数の意味はプラットフォームに依存します。

@param path パスを表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
m = File.world_readable?("/etc/passwd")
"%o" % m # => "644"
//}...

File.world_writable?(path) -> bool (21007.0)

path が全てのユーザから書き込めるならば、そのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。

...ない場合は nil を返します。

整数の意味はプラットフォームに依存します。

@param path パスを表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
m = File.world_writable?("/tmp")
"%o" % m #=> "777"
//}...
...でない場合は nil を返します。

整数の意味はプラットフォームに依存します。

@param path パスを表す文字列か IO オブジェクトを指定します。

//emlist[例][ruby]{
m = File.world_writable?("/tmp")
"%o" % m #=> "777"
//}...

File.umask -> Integer (21003.0)

現在の umask の値を返します。

現在の umask の値を返します。

@see umask(2)

File.blockdev?(path) -> bool (21001.0)

FileTest.#blockdev? と同じです。

...
File
Test.#blockdev? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。


@see FileTest.#blockdev?...

絞り込み条件を変える

<< < ... 4 5 6 7 8 ... > >>