- Look for files in Mac-like places on Macs.

- Fixed: The non-Windows CreatePath can fail if part of the path already
  exists, because mkdir will return an error code for trying to recreate
  an existing directory.



SVN r1814 (trunk)
This commit is contained in:
Randy Heit 2009-09-09 17:12:47 +00:00
commit 66920536d9
9 changed files with 119 additions and 100 deletions

View file

@ -512,12 +512,17 @@ void CreatePath(const char *fn)
{
*p = '\0';
}
printf("%s\n", copy);
struct stat info;
if (stat(copy, &info) == 0)
{
if (info.st_mode & S_IFDIR)
goto exists;
}
if (mkdir(copy, 0755) == -1)
{ // failed
return;
}
if (p != NULL)
exists: if (p != NULL)
{
*p = '/';
}