v19 xbmcvfs.exists(path) always returns False even if exists
#1
Hi,

What could be the reason that:
Code:
xbmcvfs.exists(path)
alwayes return 'False' even if exists?
Reply
#2
You aren't providing a valid path?

scott s.
.
Reply
#3
@scott967 

What do you mean by "valid path"?
Because using 'os.path' works:
python:
os.path.exists(path)

So what is the difference?
Reply
#4
what path are you feeding it that it says False to?

note the disclaimer on the documentation that paths must end with a '/' or a '\' - https://romanvm.github.io/Kodistubs/_aut...vfs.exists

it may be needed to translatepath before checking if it exists, not 100% on that ive never tried it without first calling translate
Reply
#5
(2023-04-01, 22:31)burekas Wrote: @scott967 

What do you mean by "valid path"?
Because using 'os.path' works:
python:
os.path.exists(path)

So what is the difference?

I find working examples are worth a thousand words.  If you want to see a working example of one of mine, look here, starting on line 23.  I used the special protocol too because I want it to work across all OS versions that Kodi runs on.  


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#6
If the path is a directory, it needs to end with a "/" or whatever the forward/backward slash usage is for the OS.

A good way to add it is:
python:

os.path.join(path, '')

If the path is a file, then the full path as a string is all thats needed.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmcvfs.exists(path) always returns False even if exists0