|
-
December 18th, 2003, 11:41 PM
#1
Creating deep directories
I'm trying to create a file for writing:
FILE *File = fopen( "C:\\some\\really\\deep\\directory\\blah.dat", "rb" );
The only problem is, none of these subdirectories exist, so fopen fails.
Is there a simple way to create all of these directories, when trying to
write a file?
Is there a general command to create deep directories that don't exist,
using just a single string of those sub-directories?
yeah, I can probably write up a hack to handle cases like this,
but I would rather use something that already does it if there is one.
Last edited by Syslock; December 18th, 2003 at 11:49 PM.
-
December 19th, 2003, 12:34 AM
#2
Re: Creating deep directories
Originally posted by Syslock
Is there a general command to create deep directories that don't exist,
using just a single string of those sub-directories?
Well...not to my knowledge...you have to do it one by one...
-
December 19th, 2003, 12:36 AM
#3
Re: Creating deep directories
SHCreateDirectoryEx might work for you...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
-
December 19th, 2003, 12:46 AM
#4
Re: Re: Creating deep directories
Originally posted by vicodin451
SHCreateDirectoryEx might work for you...
Cool....I guess I have to take a deeper look at the shell functions (which I tried to avoid for a long time)...
-
December 19th, 2003, 03:40 AM
#5
This function creates a file system folder whose fully qualified path is given by pszPath. If one or more of the intermediate folders do not exist, they will be created as well.
That's sounds like exactly what I need. Thanks.
-
December 19th, 2003, 06:50 AM
#6
Minimum operating systems Windows 2000, Windows Millennium Edition
-
December 19th, 2003, 03:23 PM
#7
Originally posted by kallzz
Minimum operating systems Windows 2000, Windows Millennium Edition
That's why I said might...
Thought for the day/week/month/year:
Windows System Error 4006:
Replication with a nonconfigured partner is not allowed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|