Escape spaces in file path for du command

This commit is contained in:
2023-08-25 20:30:09 +02:00
parent db03d8debf
commit 42f909a251

View File

@@ -45,7 +45,7 @@ class File():
def fileSize(self):
filePath = self.system.buildFilePath(self)
cmd = "du -hs '{}'".format(filePath)
cmd = "du -hs '{}'".format(filePath.replace(' ', '\\ '))
if self.system.remote:
cmd = 'ssh {}@{} {}'.format(self.system.user, self.system.host, cmd)