|
Pages: 1 [2]
|
 |
|
Author
|
Topic: First impressions (and some bugs) (Read 629 times)
|
|
troels
|
wxc do this not in the install job but on every startup: if (!direxists(plugindir)) mkdir(plugindir); Unsure how to proceed 
|
|
|
|
|
Logged
|
|
|
|
fireclown
Newbie

Posts: 12
|
mkdir() is a POSIX API. I have always been a bit leary of Windows' support for those APIs. I would try something like this:
#if defined(WIN32_OR_WHATEVER_YOU_USE_TO_DISTINGUISH_WINDOWS_CODE) # define wxcmkdir(P) CreateDirectory((P), NULL) #else # define wxcmkdir(P) mkdir((P)) #endif
if (!direxists(plugindir)) wxcmkdir(plugindir)
|
|
|
|
|
Logged
|
|
|
|
fireclown
Newbie

Posts: 12
|
By the way Troels, I haven't tested to see if you do this or not but please also note that there is also an equivalent to CopyFileEx for moving files as well, especially when the move needs to span across volumes (which is really then just a copy and delete). Appropriately enough the function is MoveFileEx(), although since you will want to show progress you will likely want to use MoveFileWithProgress() instead. Just FYI.
|
|
|
|
|
Logged
|
|
|
|
|
troels
|
I use MoveFileEx only when moving files between locations within the same volume and this happens in a snap. Between volumes I [now] use CopyFileEx + subsequent delete.
Thanks Troels
|
|
|
|
« Last Edit: December 11, 2008, 08:57:05 pm by troels »
|
Logged
|
|
|
|
|
|
Pages: 1 [2]
|
|
|
 |