Win Is xbmcvfs.rename() broken for Windows shares?
#1
Hi,

I have a network drive mapped on Windows (actually it is VMware shared folder).
I try to rename file on that drive with following code:

python:
    originalinputfile = "Z:\Shared_folders\The test file.txt"
    try:
        success = xbmcvfs.rename(originalinputfile, originalinputfile + '_')
        xbmc.log("rename_file: SuccessStatus: " + str(success), level=xbmc.LOGINFO)
    except Exception as e:
        xbmc.log("Can't rename file: " + originalinputfile, level=xbmc.LOGERROR)
        xbmc.log("Exception: " + e.errno + " - " + e.message, level=xbmc.LOGERROR)

and I get following error in log:

python:
10:14:52.977 T:3124   ERROR: Failed to rename file/directory \\?\Z:\Shared_folders\The test file.txt to \\?\Z:\Shared_folders\The test file.txt_, Error:
10:14:52.977 T:3124   ERROR: XFILE::CFile::Rename - Error renaming file Z:\Shared_folders\The test file.txt
10:14:52.977 T:3124    INFO: rename_file: SuccessStatus: 0

I can copy the same file from and to this share using xbmcvfs.copy().
Can be this fixed somehow?
I can try to use os.rename() but this should work also over smb: shares and that seems not to be supported.

BR,
bkiziuk
RPi4; LibreElec
Reply
#2
Please provide the full, debug-enabled kodi.log via https://pastebin.com or https://paste.ubuntu.com so we can see the whole picture. Bugs/errors can start at any (previous) moment Smile

Also check the SMB server version as Kodi now defaults to SMBv2+ due to the whole WannaCry episode last year.
Reply
#3
Log is here: https://pastebin.com/iemJWEuT
I anonimized file names only.
Regarding SMB version, I'm not really sure how VMware handles its local shared folders - is this real SMB inside or proprietary VMware mechanism.
RPi4; LibreElec
Reply
#4
I made some additional checks and it looks like that the process failed because I tried to rename it over an existing file.
The path in log: 
\\?\Z:\Shared_folders\
was misleading as it suggested issues with path handling.
RPi4; LibreElec
Reply

Logout Mark Read Team Forum Stats Members Help
Is xbmcvfs.rename() broken for Windows shares?0