|
-
April 7th, 2009, 02:02 PM
#1
CreateDirectory function
Hi all,
I have some question for using CreateDirectory, the question is that whe I want to create directory by using CreateDirectory shch as
Code:
CreateDirectory(L"XXX", NULL);
DWORD res = GetLastError();
the return value from GetLastError function tell me that I can create "XXX" directory successfully but I can not find "XXX" directory. Could everyone tell me that where it created?
Thnak very much
-
April 7th, 2009, 02:07 PM
#2
Re: CreateDirectory function
 Originally Posted by suntonphon
Hi all,
I have some question for using CreateDirectory, the question is that whe I want to create directory by using CreateDirectory shch as
Code:
CreateDirectory(L"XXX", NULL);
DWORD res = GetLastError();
the return value from GetLastError function tell me that I can create "XXX" directory successfully but I can not find "XXX" directory. Could everyone tell me that where it created?
Thnak very much
so i don't understand why aren't you designating the full path yourself. something like: L"C:\\Temp\\TestDir\\"
-
April 7th, 2009, 02:15 PM
#3
Re: CreateDirectory function
Hi Alin
Thank you for your reply
The path is get from user.
-
April 7th, 2009, 03:09 PM
#4
Re: CreateDirectory function
Unless you're using the full path name as Alin mentioned, the XXX directory will be created under the CURRENT working directory - which could possibly be anywhere...
If you start your program withing Visual Studio, at the beginning, the current working directory will be the directory containing your .sln/.vcproj files. However, if you browse for a file from within your program, the current directory may change to the folder containing the file you selected in the browse dialog.
If you run the program by double clicking on the executable (from Window Explorer), the current directory will be the folder containing the executable.
If you run the program from a desktop shortcut, the working directory will be whatever the shortcut says it should be.
THEREFORE - you really should use a full path name.
Hope that helps.
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
-
April 8th, 2009, 07:22 AM
#5
Urgent CreateDirectory issue
Hi all,
Again with CreateDirectory function, I would like to ask all of you that how can I force CreateDirectory function to not create directory in CURRENT working directory?
Thank you very much and sorry for making bord dirty.
-
April 8th, 2009, 07:40 AM
#6
Re: Urgent CreateDirectory issue
That question was answered in your other thread asking the same thing. Supply the full path.
-
April 8th, 2009, 07:46 AM
#7
Re: CreateDirectory function
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
|