www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - why mkdir can't create tree of dirs?

reply Suliman <evermind live.ru> writes:
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 C:\D\dmd2\windows\bin\..\..\src\pho
os\stdfile.d(2048): F:\foo\imgs_projected\jma_vis\1602\123:
╨б╨╕╤Б╤В╨╡╨╝╨╡ ╨╜╨╡
╤Г╨┤╨╨╡╤В╤Б╤П ╨╜╨░╨╣╤В╨╕
╤Г╨║╨░╨╖╨░╨╜╨╜╤Л╨╣ ╨┐╤Г╤В╤М.
(error 3)
Feb 09 2016
next sibling parent reply anonymous <anonymous example.com> writes:
On Tuesday, 9 February 2016 at 20:20:59 UTC, Suliman 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
http://dlang.org/phobos/std_file.html#.mkdirRecurse
 td.windows.syserror.WindowsException C:\D\dmd2\windows\bin\..\..\src\pho
os\stdfile.d(2048): F:\foo\imgs_projected\jma_vis\1602\123:
╨б╨╕╤Б╤В╨╡╨╝╨╡ ╨╜╨╡
╤Г╨┤╨╨╡╤В╤Б╤П ╨╜╨░╨╣╤В╨╕
╤Г╨║╨░╨╖╨░╨╜╨╜╤Л╨╣ ╨┐╤Г╤В╤М.
(error 3)
What's up with that garbled text?
Feb 09 2016
parent Kagamin <spam here.lot> writes:
On Tuesday, 9 February 2016 at 21:03:34 UTC, anonymous wrote:
 What's up with that garbled text?
https://issues.dlang.org/show_bug.cgi?id=2742
Feb 10 2016
prev sibling next sibling parent Wyatt <wyatt.epp gmail.com> writes:
On Tuesday, 9 February 2016 at 20:20:59 UTC, Suliman 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
http://dlang.org/phobos/std_file.html#.mkdirRecurse -Wyatt
Feb 09 2016
prev sibling parent reply Jonathan M Davis via Digitalmars-d-learn writes:
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 C:\D\dmd2\windows\bin\..\..\src\pho
os\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
Feb 09 2016
parent Suliman <evermind live.ru> writes:
On Tuesday, 9 February 2016 at 23:23:10 UTC, Jonathan M Davis 
wrote:
 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 C:\D\dmd2\windows\bin\..\..\src\pho
os\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
What profit to split it's in two functions? Why mkdir can't work in recursive mode?
Feb 10 2016