Restored from previous forum. Originally posted by Fangbeast.
The experts all have their ways of doing things but nonetheless, here is my quickie for making multi level subdirectories.
Always pass it a fully qualified path which includes the drive name, the path and the filename. Modify it to suit yourself but I use this as part of a file "DIFF" compare and copy routine.
Code: Select all
filestring.s = "E:\level 1\level 2\level 3\level 4\level 5\humongous file.exe"
Procedure.s MakeDirectory(filestring.s)
filename.s = GetFilePart(filestring)
directory.s = GetPathPart(filestring)
drivename.s = Left(directory, 3)
directory.s = Mid(directory, 4, Len(directory) - 3)
make.s = drivename
While FindString(directory,"\", 1) <> 0
position = FindString(directory,"\", 1)
temp.s = Left(directory, position -1)
directory = Mid(directory, position + 1, Len(directory) - position)
make + temp + "\"
CreateDirectory(make)
Wend
ProcedureReturn make
EndProcedure
filepath.s = MakeDirectory(filestring)
Hope it helps someone, it did me

We are Dyslexic of Borg, prepare to have your ass laminated!