This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: CreateDir Not working
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 03, 2008
05:34 PM
CreateDir Not working
I've been trying to get this to work for a while now, using several examples I've found on the boards here...
This is what I have
[FONT="Arial"]///////////////////////////
// MakeBackUpDirs
///////////////////////////
function MakeBackUpDirs()
number nReturn;
begin
nReturn= CreateDir(TARGETDIR + "\\Backup");
if nReturn = 0 then
NumToStr(sReturn, nReturn);
MessageBox ("Can not create backup directory under C:\Swisslog.",SEVERE);
abort;
endif; [/FONT]
end;
IT will not create the directory....
Anyone have any ideas why?
Thanks
:mad:
This is what I have
[FONT="Arial"]///////////////////////////
// MakeBackUpDirs
///////////////////////////
function MakeBackUpDirs()
number nReturn;
begin
nReturn= CreateDir(TARGETDIR + "\\Backup");
if nReturn = 0 then
NumToStr(sReturn, nReturn);
MessageBox ("Can not create backup directory under C:\Swisslog.",SEVERE);
abort;
endif; [/FONT]
end;
IT will not create the directory....
Anyone have any ideas why?
Thanks
:mad:
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2008
10:53 AM
One thing you might want to try is replacing:
nReturn= CreateDir(TARGETDIR + "\\Backup");
with:
nReturn= CreateDir(TARGETDIR ^ "Backup");
In the event that TARGETDIR is being resolved to "C:\Swisslog\".
nReturn= CreateDir(TARGETDIR + "\\Backup");
with:
nReturn= CreateDir(TARGETDIR ^ "Backup");
In the event that TARGETDIR is being resolved to "C:\Swisslog\".
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2008
04:42 PM
And to find out more specifically why it is failing, use FormatMessage to get the error related to the error code, instead of the MessageBox.
SprintfBox(SEVERE, "Create Dir Error...", "Could not create backup directory under %s.\n" + "Error number: %d \n %s", TARGETDIR, nReturn, FormatMessage(nReturn) );
SprintfBox(SEVERE, "Create Dir Error...", "Could not create backup directory under %s.\n" + "Error number: %d \n %s", TARGETDIR, nReturn, FormatMessage(nReturn) );
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 09, 2008
11:08 AM
I hadn't checked this yesterday... Thanks - I'll give each suggestion a try!:)
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)