+Version 1.7.2-BETA:
+ Made yet another round of performance improvements to the XPRESS, LZX,
+ and LZMS compressors.
+
+ On Windows, wimextract and its underlying library function
+ wimlib_extract_paths() will no longer fail if given a target directory
+ path ending in a slash.
+
Version 1.7.1:
Made more improvements to the XPRESS, LZX, and LZMS compressors.
static int
mkdir_if_needed(const tchar *target)
{
- struct stat stbuf;
- if (tstat(target, &stbuf)) {
- if (errno == ENOENT) {
- if (tmkdir(target, 0755)) {
- ERROR_WITH_ERRNO("Failed to create directory "
- "\"%"TS"\"", target);
- return WIMLIB_ERR_MKDIR;
- }
- } else {
- ERROR_WITH_ERRNO("Failed to stat \"%"TS"\"", target);
- return WIMLIB_ERR_STAT;
- }
- } else if (!S_ISDIR(stbuf.st_mode)) {
- ERROR("\"%"TS"\" is not a directory", target);
- return WIMLIB_ERR_NOTDIR;
- }
- return 0;
+ if (!tmkdir(target, 0755))
+ return 0;
+
+ if (errno == EEXIST)
+ return 0;
+
+#ifdef __WIN32__
+ /* _wmkdir() fails with EACCES if called on a drive root directory. */
+ if (errno == EACCES)
+ return 0;
+#endif
+
+ ERROR_WITH_ERRNO("Failed to create directory \"%"TS"\"", target);
+ return WIMLIB_ERR_MKDIR;
}
/* Make sure the extraction flags make sense, and update them if needed. */