Skip to content

Commit

Permalink
fix(Core/writer): correct iswritable on 1.11+
Browse files Browse the repository at this point in the history
If the file doesn't exist, check the folder.
  • Loading branch information
tecosaur committed Oct 13, 2024
1 parent 2eb8c39 commit fb1bd40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Core/src/model/writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ function Base.iswritable(dc::DataCollection)
!isnothing(dc.path) || return false
get(dc, "locked", false) !== true || return false
@static if VERSION >= v"1.11"
iswritable(dc.path)
if isfile(dc.path)
iswritable(dc.path)
else
iswritable(dirname(dc.path))
end
else
try # why is this such a hassle?
open(io -> iswritable(io), dc.path, "a")
Expand Down

0 comments on commit fb1bd40

Please sign in to comment.