std::string(pathname) + ": can't create temporary directory");
return Path();
}
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkdtemp didn't create a valid pathname!");
- return result;
+ return Path(pathname);
#elif defined(HAVE_MKSTEMP)
// If no mkdtemp is available, mkstemp can be used to create a temporary file
// which is then removed and created as a directory. We prefer this over
std::string(pathname) + ": can't create temporary directory");
return Path();
}
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkstemp didn't create a valid pathname!");
- return result;
+ return Path(pathname);
#elif defined(HAVE_MKTEMP)
// If a system doesn't have mkdtemp(3) or mkstemp(3) but it does have
// mktemp(3) then we'll assume that system (e.g. AIX) has a reasonable
std::string(TmpName) + ": can't create temporary directory");
return Path();
}
- Path result;
- result.set(TmpName);
- assert(result.isValid() && "mktemp didn't create a valid pathname!");
- return result;
+ return Path(TmpName);
#else
// This is the worst case implementation. tempnam(3) leaks memory unless its
// on an SVID2 (or later) system. On BSD 4.3 it leaks. tmpnam(3) has thread
std::string(pathname) + ": can't create temporary directory");
return Path();
}
- Path result;
- result.set(pathname);
- assert(result.isValid() && "mkstemp didn't create a valid pathname!");
- return result;
+ return Path(pathname);
#endif
}
return false;
std::string save(path);
path = a_path;
- if (!isValid()) {
- path = save;
- return false;
- }
return true;
}
if (!lastIsSlash(path))
path += '/';
path += name;
- if (!isValid()) {
- path = save;
- return false;
- }
return true;
}
return true;
}
}
- if (!isValid())
- path = save;
return false;
}