< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #12307 has been reported by Benoit Daloze.
----------------------------------------
Bug #12307: File.new and File.open change permissions even if the file exists on Windows
https://bugs.ruby-lang.org/issues/12307
* Author: Benoit Daloze
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
For instance:
~~~
# New file
File.open("abc", "w", 0666) { |f|
puts f.stat.mode.to_s(8) # => 100666, OK
}
# File exists
File.open("abc", "w", 0466) { |f|
puts f.stat.mode.to_s(8) # => 100444, BUG
}
~~~
So the mode of the file was changed even though the file already exists.
This is inconsistent with the behavior on other platforms such as UNIX which only consider mode for new files.
open(2) is fairly clear about this on Linux and OS X: "if neither O_CREAT nor O_TMPFILE is specified, then mode is ignored".
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>