Fix local file path writing
This commit is contained in:
parent
b7d5964512
commit
9a599a06de
2 changed files with 6 additions and 5 deletions
|
@ -274,13 +274,14 @@ namespace Util{
|
||||||
}else{
|
}else{
|
||||||
int flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
|
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);
|
int mode = O_RDWR | O_CREAT | (append ? O_APPEND : O_TRUNC);
|
||||||
if (!Util::createPathFor(uri)){
|
std::string path = target.getFilePath();
|
||||||
ERROR_MSG("Cannot not create file %s: could not create parent folder", uri.c_str());
|
if (!Util::createPathFor(path)){
|
||||||
|
ERROR_MSG("Cannot not create file %s: could not create parent folder", path.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
outFile = open(uri.c_str(), mode, flags);
|
outFile = open(path.c_str(), mode, flags);
|
||||||
if (outFile < 0){
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -615,7 +615,7 @@ namespace Mist{
|
||||||
timer = Util::getMicros(timer);
|
timer = Util::getMicros(timer);
|
||||||
INFO_MSG("Created header in %.3f ms (%zu tracks)", (double)timer/1000.0, M?M.trackCount():(size_t)0);
|
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
|
//Write header to file for caching purposes
|
||||||
M.toFile(HTTP::localURIResolver().link(config->getString("input") + ".dtsh").getUrl());
|
M.toFile(config->getString("input") + ".dtsh");
|
||||||
}
|
}
|
||||||
postHeader();
|
postHeader();
|
||||||
if (config->getBool("headeronly")){return 0;}
|
if (config->getBool("headeronly")){return 0;}
|
||||||
|
|
Loading…
Add table
Reference in a new issue