Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow file writes to new subdirectories in remote Storage Groups

If the subdirectory for a file to be written does not exist, then
create the path to the subdirectory instead of failing inside the
ThreadedFileWriter.
  • Loading branch information...
commit 8fdfa7589909f6197864b3db106c7b80bdf43c3e 1 parent 45b8f89
@cpinkham cpinkham authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 mythtv/programs/mythbackend/mainserver.cpp
View
17 mythtv/programs/mythbackend/mainserver.cpp
@@ -1450,7 +1450,24 @@ void MainServer::HandleAnnounce(QStringList &slist, QStringList commands,
}
if (writemode)
+ {
+ QString dirPath = finfo.absolutePath();
+ QDir qdir(dirPath);
+ if (!qdir.exists())
+ {
+ if (!qdir.mkpath(dirPath))
+ {
+ VERBOSE(VB_IMPORTANT, QString("ERROR: FileTransfer "
+ "filename '%1' is in a subdirectory which does "
+ "not exist, but can not be created.")
+ .arg(filename));
+ errlist << "filetransfer_unable_to_create_subdirectory";
+ socket->writeStringList(errlist);
+ return;
+ }
+ }
ft = new FileTransfer(filename, socket, writemode);
+ }
else
ft = new FileTransfer(filename, socket, usereadahead, timeout_ms);

0 comments on commit 8fdfa75

Please sign in to comment.
Something went wrong with that request. Please try again.