るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

File#path -> String (6102.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 (6102.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 (108.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+" など)で...

File#chown(owner, group) -> 0 (102.0)

ファイルのオーナーとグループを変更します。

...した場合は
例外 Errno::EXXX が発生します。

@param owner chown(2) と同様に数値で指定します。nil または -1 を指定することで、オーナーを現在のままにすることができます。

@param group chown(2) と同様に数値で指定します。nil また...
...ます。

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

//emlist[例][ruby]{
File
.open("testfile") { |f| f.chown(502, 1000) } # => 0
File
.stat("testfile").uid # => 502
File
.stat("testfile").gid # => 1000
//}

@see File.chown...

File#lstat -> File::Stat (14.0)

ファイルの状態を含む File::Stat オブジェクトを生成して返します。 シンボリックリンクに関してリンクそのものの情報を返します。 lstat(2) を実装していないシステムでは、IO#statと同じです。

...ファイルの状態を含む File::Stat オブジェクトを生成して返します。
シンボリックリンクに関してリンクそのものの情報を返します。
lstat(2) を実装していないシステムでは、IO#statと同じです。

@raise Errno::EXXX 失敗した場合...
...ose されている場合に発生します。

//emlist[例][ruby]{
# testlink は testfile のシンボリックリンク
File
.open("testlink") do |f|
p
f.lstat == File.stat("testfile") # => false
p
f.stat == File.stat("testfile") # => true
end
//}

@see IO#stat, File.stat, File.lstat...

絞り込み条件を変える