diff --git a/lib/util.cpp b/lib/util.cpp index 839e44ae..9e317b81 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -274,13 +274,14 @@ namespace Util{ }else{ int flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; int mode = O_RDWR | O_CREAT | (append ? O_APPEND : O_TRUNC); - if (!Util::createPathFor(uri)){ - ERROR_MSG("Cannot not create file %s: could not create parent folder", uri.c_str()); + std::string path = target.getFilePath(); + if (!Util::createPathFor(path)){ + ERROR_MSG("Cannot not create file %s: could not create parent folder", path.c_str()); return false; } - outFile = open(uri.c_str(), mode, flags); + outFile = open(path.c_str(), mode, flags); if (outFile < 0){ - ERROR_MSG("Failed to open file %s, error: %s", uri.c_str(), strerror(errno)); + ERROR_MSG("Failed to open file %s, error: %s", path.c_str(), strerror(errno)); return false; } } diff --git a/src/input/input.cpp b/src/input/input.cpp index 324b02af..24ae2597 100644 --- a/src/input/input.cpp +++ b/src/input/input.cpp @@ -615,7 +615,7 @@ namespace Mist{ timer = Util::getMicros(timer); INFO_MSG("Created header in %.3f ms (%zu tracks)", (double)timer/1000.0, M?M.trackCount():(size_t)0); //Write header to file for caching purposes - M.toFile(HTTP::localURIResolver().link(config->getString("input") + ".dtsh").getUrl()); + M.toFile(config->getString("input") + ".dtsh"); } postHeader(); if (config->getBool("headeronly")){return 0;}