るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.022秒)
トップページ > バージョン:2.4.0[x] > ライブラリ:ビルトイン[x] > クエリ:errno[x] > クラス:File[x] > クエリ:symlink[x]

別のキーワード

  1. _builtin errno
  2. exxx errno
  3. systemcallerror errno
  4. new errno::exxx
  5. send errno::exxx

キーワード

検索結果

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

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

...発生します。

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

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

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

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

File.lchmod(mode, *filename) -> Integer (46.0)

File.chmod と同様ですが、シンボリックリンクに関してリンクそのものの モードを変更します。

...
File
.chmod と同様ですが、シンボリックリンクに関してリンクそのものの
モードを変更します。

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

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

@raise NotImplementedError lchmod(2)...
...生します。

//emlist[例][ruby]{
IO.write("testfile", "test")
File
.symlink("testfile", "testlink")
File
.lstat("testlink").ftype # => "link"
File
.lchmod(0744, "testlink")
File
.stat("testlink").mode.to_s(8) # => "100644"
File
.lstat("testlink").mode.to_s(8) # => "120744"
//}...

File.readlink(path) -> String (46.0)

シンボリックリンクのリンク先のパスを文字列で返します。

...XX 指定された path がシンボリックリンクでない場合や、リンクの読み取りに失敗した場合に発生します。

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

File.realpath(pathname, basedir = nil) -> String (46.0)

与えられた pathname に対応する絶対パスを返します。

...合に発生します。

//emlist[例][ruby]{
ENV["HOME"] # => "/home/matz"
File
.symlink("testfile", "testlink")
File
.realpath("testfile") # => "/home/matz/testfile"
File
.realpath("testlink") # => "/home/matz/testfile"
File
.realpath("..", "/tmp") # => "/"
//}...