2021-03-14, 18:27
Someone posted an Issue on the GitHub for my Backup Addon that has me wondering about the rmdir() function in the xbmcvfs Python module.
In previous versions of the addon I've always used the rmdir() function to clean up old Backup archives files based on the user's defined rotation preference. Since the release of Kodi 19 this hasn't been working. Testing on different file systems confirms errors trying to delete directories that still have files in them. As a test I wrote a quick function to recursively delete files/folders in a loop. This worked and everything was removed properly.
My question is: did something change with the rmdir() function? Does it now require an empty directory or you get an error? I did some searching and couldn't find a definitive answer. If that's the case I can use my loop to clean it out; just confusing since this has always worked previously. Want to make sure it's a "feature" not a "bug" before attempting a work around.
Link to issue:
https://github.com/robweber/xbmcbackup/issues/186
Line in the Matrix version of addon (pretty sure this worked in Alpha versions):
https://github.com/robweber/xbmcbackup/b...up.py#L491
Same code line in Krypton/Leia compatible version.
https://github.com/robweber/xbmcbackup/b...up.py#L473
In previous versions of the addon I've always used the rmdir() function to clean up old Backup archives files based on the user's defined rotation preference. Since the release of Kodi 19 this hasn't been working. Testing on different file systems confirms errors trying to delete directories that still have files in them. As a test I wrote a quick function to recursively delete files/folders in a loop. This worked and everything was removed properly.
My question is: did something change with the rmdir() function? Does it now require an empty directory or you get an error? I did some searching and couldn't find a definitive answer. If that's the case I can use my loop to clean it out; just confusing since this has always worked previously. Want to make sure it's a "feature" not a "bug" before attempting a work around.
Link to issue:
https://github.com/robweber/xbmcbackup/issues/186
Line in the Matrix version of addon (pretty sure this worked in Alpha versions):
https://github.com/robweber/xbmcbackup/b...up.py#L491
Same code line in Krypton/Leia compatible version.
https://github.com/robweber/xbmcbackup/b...up.py#L473