るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dsa p
  5. rsa p

ライブラリ

キーワード

検索結果

File#path -> String (6108.0)

オープン時に使用したパスを文字列で返します。

...
File
::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...
...TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp",...
...File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

File#to_path -> String (6108.0)

オープン時に使用したパスを文字列で返します。

...
File
::Constants::TMPFILEオプション付きで作成されていたりする場合です。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp", File::R...
...DWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...
...TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。

//emlist[例][ruby]{
File
.open("testfile") {|f| f.path } #=> "testfile"
File
.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File
.open("/tmp",...
...File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

File#flock(operation) -> 0 | false (120.0)

ファイルをロックします。

...ックの取得に成功した場合は 0 を返します。
File
::LOCK_NB (ノンブロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すようになります。

@param operation ロックに対する操作の種類を示す定数...
...

@raise Errno::EXXX operation に不正な整数を与えた場合などに発生します。

引数 operation に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File
クラスの親クラスの IO が File::Constants をインクルード...
...しているので、
これらの定数は File::LOCK_SH などとして参照可能です。

: LOCK_SH
共有ロック。複数のプロセスが同時にロックを共有できます。
システムによってはロック対象のファイルは読み込みモード
("r", "r+" など)でオ...