るりまサーチ

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

別のキーワード

  1. rexml/document write
  2. _builtin write
  3. io write
  4. csv write_headers?
  5. stringio write

種類

ライブラリ

クラス

キーワード

検索結果

File.unlink(*filename) -> Integer (15161.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.8.3 feature (216.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...]
: FileUtils.chown_R [lib] [new]
: FileUtils.commands [lib] [new]
: FileUtils.options [lib] [new]
: FileUtils.have_option? [lib] [new]
: FileUtils.options_of [lib] [new]
: FileUtils.collect_method [lib] [new]

追加。

: FileUtils.rm_r [l...
...cat test_dlg.rb
foo = Object.new
foo2 = SimpleDelegator.new(foo)
def foo.bar
puts "bar"
end
foo2.bar

$ ruby-1.8.2 -r delegate test_dlg.rb
test
_dlg.rb:6: undefined method `bar' for #<Object:0x4021b0a0> (NoMethodError)

$ ruby-1.8.3 -r delegate test_dl...
...ass << "str"; self end.dup'
-e:1:in `initialize_copy': can't copy singleton class (TypeError)
from -e:1

=== 2005-05-15
: Pathname#unlink [lib] [compat]
ディレクトリへのシンボリックリンクも削除されるようになりました。((<ruby-core:4992>))

=== 2005-05...

ruby 1.6 feature (156.0)

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

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

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...=> ruby 1.6.7 (2002-07-30) [i586-linux]

: 2002-05-20 IO#close

双方向のパイプの dup を close_write するとエラーになっていました。
((<ruby-dev:17155>))

open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}

=> ru...
...: 2002-03-08 class variable

((<ruby-talk:35122>))

class C
class << self
def test
@@cv = 5
p @@cv
end
end

test

end
=> -:5:in `test': uninitialized class variable @@cv in C (NameError)
from -:9
ruby 1.6.7 (2002...

File.delete(*filename) -> Integer (61.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
//}...