Not sure why this would fail? Shouldn't this path be created if it doesn't exist and if it already exists, then give a true
for isdir()
?
isdir(pth2) || mkdir(pth2)
error:
IOError: mkdir("Y:/Canon Images for Dynamic Heart Phantom/Dynamic Phantom/clean_data/CONFIG 1^275/52/HR 60 KV 80 SEGMENT"; mode=0o777): file already exists (EEXIST)
uv_error@libuv.jl:97[inlined]
var"#mkdir#7"(::UInt16, ::typeof(mkdir), ::String)@file.jl:179
mkdir@file.jl:172[inlined]
top-level scope@Local: 1[inlined]
Could it be that your path is a file?
If you are missing multiple directory levels in the path, isdir
will return false and mkdir
fail. mkpath
is your friend. But from the error message I agree that it looks likely that the path is a file.
Oh that's weird, some earlier code must have renamed a file to that path. I gotta figure out what I am doing wrong
Also mkdir -p
may be handy..
mkdir -p
works the same way as Julia's mkpath
.
Ahh I was wondering what that does but I didn’t want to expose my lack of understanding. Thanks to both of you!
Last updated: Dec 28 2024 at 04:38 UTC