Skip to content
Permalink
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
cpinkham committed Dec 28, 2010
1 parent 45b8f89 commit 8fdfa7589909f6197864b3db106c7b80bdf43c3e
Showing with 17 additions and 0 deletions.
  1. +17 −0 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.
You can’t perform that action at this time.