Skip to content

Commit

Permalink
Check for existence again
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Sep 20, 2024
1 parent 84f36f1 commit 0642aff
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/stdlib_io_filesystem.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,13 @@ subroutine list_dir(dir, files, iostat, iomsg)

stat = 0

if (is_windows()) then
if (.not. exists(temp_dir)) then
call run('mkdir '//temp_dir, stat)
else
call run('mkdir -p '//temp_dir, stat)
end if

if (stat /= 0) then
if (present(iostat)) iostat = stat
if (present(iomsg)) iomsg = "Failed to create temporary directory '"//temp_dir//"'."
return
if (stat /= 0) then
if (present(iostat)) iostat = stat
if (present(iomsg)) iomsg = "Failed to create temporary directory '"//temp_dir//"'."
return
end if
end if

call run('ls '//dir//' > '//listed_contents, stat)
Expand Down

0 comments on commit 0642aff

Please sign in to comment.