why mkdir can't create tree of dirs?
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Feb 9 15:23:10 PST 2016
On Tuesday, February 09, 2016 20:20:59 Suliman via Digitalmars-d-learn wrote:
> It's look like that I can only create one nesting level sub
> folder, for example there is exists dir: D:\foo
> I can't create dir D:\foo\bar\baz I can only create D:\foo\bar
>
> D:\foo\bar
>
> Is it's rational limit or it is bug? Here is error when I tried
> to folder in folder thet do not exists.
>
> It's not very handy to write all levels by hands...
>
> td.windows.syserror.WindowsException at C:\D\dmd2\windows\bin\..\..\src\phobos\stdfile.d(2048): F:\foo\imgs_projected\jma_vis\1602\123: ╨б╨╕╤Б╤В╨╡╨╝╨╡ ╨╜╨╡ ╤Г╨┤╨╨╡╤В╤Б╤П ╨╜╨░╨╣╤В╨╕ ╤Г╨║╨░╨╖╨░╨╜╨╜╤Л╨╣ ╨┐╤Г╤В╤М. (error 3)
You can use std.file.mkdirRecurse instead of std.file.mkdir.
std.file.mkdirRecurse is similar to mkdir -p like std.file.mkdir is similar
to mkdir.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list