CREATEDIR

BlitzPlus Forums/BlitzPlus Beginners Area/CREATEDIR

Panno(Posted 2006) [#1]
createdir "c:\aaa\aaa" will not work here its the demo or ?

b+ demo version 1.43


GfK(Posted 2006) [#2]
Try CreateDir "C:aaa\aaa"


b32(Posted 2006) [#3]
I think you need to create each level separately:
CreateDir "c:\aaa"
CreateDir "c:\aaa\aaa"


GfK(Posted 2006) [#4]
The docs say you don't need the first backslash after C:.


b32(Posted 2006) [#5]
The 'trailing backslash' ? That is the backslash at the end of the folder name:
c:\aaa\ <- trailing slash
c:\aaa
The example in the docs is a bit confusing. All the slashes seem to be missing. If you try to create the folder "c:winntsystem32myfolder" and then check it's filetype, it returns 2. However the folder is not created. Probably it only checks the existance of drive "C:", because if you change it to "z:winntsystem32myfolder" filetype returns a zero.
But in the archives is an example that creates folders and subfolders at once.


Adam Novagen(Posted 2006) [#6]
Okay, I'm going to inject some sanity here, a rare occurence for me. Panno, b32 is right: you need to create each nonexistent folder separately. In other words, CreateDir "C:\aaa" will work fine, because it creates a dir on the hard drive. However, CreateDir "C:\aaa\aaa" will NOT work unless your hard drive already contains a folder called "aaa". So yeah, any folders that don't already exist need to be created one at a time.


Panno(Posted 2006) [#7]
thx

i create each folder seperatly now

:)


GfK(Posted 2006) [#8]
In that case, the docs are wrong. They show NO backslash immediately after "C:".


Adam Novagen(Posted 2007) [#9]
I don't know about this backslash deal. To my knowledge, since drive C: is technically regarded by the system as a directory, the backslash should be necessary. As for the trailing backslash, I never bother with it, but I have found that it doesn't actually make a difference, on or off.