Skip to content

Commit

Permalink
work around windows slow filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Nov 15, 2023
1 parent 358576d commit 3d49df3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stdlib/Profile/src/Profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1254,9 +1254,10 @@ function take_heap_snapshot(all_one::Bool=false; dir::Union{Nothing,S}=nothing)
if isnothing(dir)
wd = pwd()
fpath = joinpath(wd, fname)
fpath_test = fpath * ".test" # use a different test file as windows can fail to save immediately after rm-ing a file
try
touch(fpath)
rm(fpath; force=true)
touch(fpath_test)
rm(fpath_test; force=true)
catch
@warn "Cannot write to current directory `$(pwd())` so saving heap snapshot to `$(tempdir())`" maxlog=1 _id=Symbol(wd)
fpath = joinpath(tempdir(), fname)
Expand Down

0 comments on commit 3d49df3

Please sign in to comment.