Skip to content

Commit

Permalink
Declare File::SHARE_DELETE constant
Browse files Browse the repository at this point in the history
Close #3745
  • Loading branch information
andrykonchin committed Dec 16, 2024
1 parent c5f6ba2 commit cc76155
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Compatibility:
* Add `Dir.for_fd` (#3681, @andrykonchin).
* Add `Dir.fchdir` (#3681, @andrykonchin).
* Add `Dir#chdir` (#3681, @andrykonchin).
* Declare `File::SHARE_DELETE` constant (#3745, @andrykonchin).

Performance:

Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/core/file/constants/constants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"FNM_DOTMATCH", "FNM_EXTGLOB", "FNM_NOESCAPE", "FNM_PATHNAME",
"FNM_SYSCASE", "LOCK_EX", "LOCK_NB", "LOCK_SH",
"LOCK_UN", "NONBLOCK", "RDONLY",
"RDWR", "TRUNC", "WRONLY"].each do |const|
"RDWR", "TRUNC", "WRONLY", "SHARE_DELETE"].each do |const|
describe "File::Constants::#{const}" do
it "is defined" do
File::Constants.const_defined?(const).should be_true
Expand Down
2 changes: 2 additions & 0 deletions src/main/ruby/truffleruby/core/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ module Constants
NONBLOCK = Truffle::Config['platform.file.O_NONBLOCK']
SYNC = Truffle::Config['platform.file.O_SYNC']

SHARE_DELETE = 0 # a pseudo file mode flag that's meaningful only on Windows

if value = Truffle::Config.lookup('platform.file.O_TMPFILE')
TMPFILE = value
end
Expand Down

0 comments on commit cc76155

Please sign in to comment.