Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating a folder

0 views
Skip to first unread message

Seth

unread,
Jul 24, 2003, 11:26:39 AM7/24/03
to

I am saving some files with CFile and CArchive.
I am getting an error after I try to Close() my archive.
This is the first time I have tried creating a file in a
branch/folder that does not exist.
Is the error beause of that and how do I create folders??
or what else could it be??

thanks

David Crow [MCSD]

unread,
Jul 24, 2003, 2:17:36 PM7/24/03
to
CreateDirectory()

"Seth" <seth...@hotmail.com> wrote in message
news:012301c351f7$fa567d50$a101...@phx.gbl...

Joseph M. Newcomer

unread,
Jul 26, 2003, 10:13:56 PM7/26/03
to
Yes. If you give the name
c:\a\b\c.txt
then a and a\b must exist. If they do not, it will fail.

Furthermore, if you try to create the directory
c:\a\b
and c:\a does not exist, CreateDirectory will fail for the same reason.

You might take a look at my Registry library on my MVP Tips site. Registry entries have
the same limitation, so I have a recursive create function that will "unwind" and create
each directory step-by-step. You could use this code if you need to create arbitrrary
paths, replacing the create-registry-entry with CreateDirectory.
joe

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

0 new messages