+ if(argfn.DirExists())
+ {
+ // First, try creating as a directory
+ cfurlCurrentFile = CFURLCreateWithFileSystemPath(
+ kCFAllocatorDefault,
+ wxMacCFStringHolder(*argv,
+ wxLocale::GetSystemEncoding()),
+ kDefaultPathStyle,
+ true); //true == directory
+ }
+ else if(argfn.FileExists())
+ {
+ // And if it isn't a directory try creating it
+ // as a regular file
+ cfurlCurrentFile = CFURLCreateWithFileSystemPath(
+ kCFAllocatorDefault,
+ wxMacCFStringHolder(*argv,
+ wxLocale::GetSystemEncoding()),
+ kDefaultPathStyle,
+ false); //false == regular file
+ }
+ else
+ {
+ // Argument did not refer to
+ // an entry in the local filesystem,
+ // so try creating it through CFURLCreateWithString
+ cfurlCurrentFile = CFURLCreateWithString(