-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04.12.2011 13:20, Mc Ben wrote:> On Ruby 1.9.3 (win7(64))
>
> ''cause code says more the thousand words: ##################
> open("test.txt","r").each do end # doesn''t
close file FileUtils.rm
> "test.txt" # will fail: Permission denied
> ################## (it doesn''t matter if the "do end" is
filled or
> omitted)
>
> Bug, ''Feature'' or my mistake?
>
What does this have to do with wxRuby?
...and yes, it?s your mistake. File.open without a block doesn?t close
the file: http://ruby-doc.org/core-1.9.3/File.html#method-c-open
What you?re doing in your code is calling File.open without a block
and then calling File#each with a block.
Vale,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJO23JSAAoJELh1XLHFkqhaAIIH/RF6nUeE8/YEe1jmqHZQoPQq
H5TID6G/krF3UR3zEpLwefLaDDcYt7YE4H8YOht6GnWDtvFVJwStQOdGUCIvy0kQ
72HC2QXz2Mu63a32RvLyZsXvZw4JtXKrtmohU0Q10lkWPb7UH8GgGMlNEhHE5N+T
Nl2XVjsd0n30FgvoGtJMk+S1bc/bnsngEpOU5F+DSlbFL49iJ+cQZ2QAY96S+RTO
t2rPSOSiZZ6kLv3QDHlCqNkHENSaNgLERa2Tpl32ZZavG+XScDta2UA1OQm4pc6h
mbphAqV5wXCmK1wWsxBau3970pNE+4jduYsFuEZlLET/3VTeR2KU7yaeyxmKVsc=fEND
-----END PGP SIGNATURE-----