Skip to content

Commit 08fdec7

Browse files
committed
[GR-18163] Declare File::SHARE_DELETE constant
PullRequest: truffleruby/4428
2 parents c5f6ba2 + cc76155 commit 08fdec7

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Compatibility:
4040
* Add `Dir.for_fd` (#3681, @andrykonchin).
4141
* Add `Dir.fchdir` (#3681, @andrykonchin).
4242
* Add `Dir#chdir` (#3681, @andrykonchin).
43+
* Declare `File::SHARE_DELETE` constant (#3745, @andrykonchin).
4344

4445
Performance:
4546

spec/ruby/core/file/constants/constants_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"FNM_DOTMATCH", "FNM_EXTGLOB", "FNM_NOESCAPE", "FNM_PATHNAME",
55
"FNM_SYSCASE", "LOCK_EX", "LOCK_NB", "LOCK_SH",
66
"LOCK_UN", "NONBLOCK", "RDONLY",
7-
"RDWR", "TRUNC", "WRONLY"].each do |const|
7+
"RDWR", "TRUNC", "WRONLY", "SHARE_DELETE"].each do |const|
88
describe "File::Constants::#{const}" do
99
it "is defined" do
1010
File::Constants.const_defined?(const).should be_true

src/main/ruby/truffleruby/core/file.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ module Constants
8282
NONBLOCK = Truffle::Config['platform.file.O_NONBLOCK']
8383
SYNC = Truffle::Config['platform.file.O_SYNC']
8484

85+
SHARE_DELETE = 0 # a pseudo file mode flag that's meaningful only on Windows
86+
8587
if value = Truffle::Config.lookup('platform.file.O_TMPFILE')
8688
TMPFILE = value
8789
end

0 commit comments

Comments
 (0)