るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.009秒)
トップページ > クエリ:begin[x] > クエリ:unlink[x]

別のキーワード

  1. _builtin begin
  2. range begin
  3. matchdata begin
  4. arithmeticsequence begin
  5. begin _builtin

種類

ライブラリ

クラス

キーワード

検索結果

File.unlink(*filename) -> Integer (15113.0)

ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。

...

//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("test.txt") # => false
begin

File.delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}...

ruby 1.6 feature (42.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ket#addr がゴミを返していました(BSD の場合?)。
((<ruby-bugs-ja:PR#85>))

# server
require 'socket'
File.unlink("/tmp/sss")
sock = UNIXServer.new("/tmp/sss").accept

# client
require 'socket'
sock = UNIXSocket.new("/tmp/sss")....
...re dumped
end
}

: $SAFE / ((<File>)).unlink

File.unlink は引数が汚染されてなくても $SAFE >= 2 の環境下では
禁止するようになりました。((<ruby-dev:13426>))

touch foo
ruby -v -e '$SAFE=2;File.unlink("foo")'

=> ruby 1.6.3 (2001-03-19) [i586-l...
...問題に対処しました。((<ruby-dev:13194>))

: Ctrl-C (Interrupt)が効かなくなる

((<ruby-dev:13195>))

th1 = Thread.start {
begin

Thread.stop
ensure
Thread.pass
Thread.stop
end
}
sleep 1

(確認できる限りでは ruby-1.7.0...

File.delete(*filename) -> Integer (13.0)

ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。

...

//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("test.txt") # => false
begin

File.delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}...

NEWS for Ruby 2.5.0 (12.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ile.executable_real?, File.mkfifo, File.readlink,
File.truncate, File#truncate, File.chmod, File.lchmod, File.chown,
File.lchown, File.unlink, File.utime, File.lstat はGVLを解放するようになりました
* File.lutime を追加 4052

* Hash
* Hash#transform_keys を追...
...ました 11952
* Process.last_status を追加。$? と同じです 14043

* Range
* Range.new no longer hides exceptions when comparing begin and
end with #<=> and raise a "bad value for range" ArgumentError
but instead lets the exception from the #<=> call go through....