Kodi Community Forum

Full Version: Writing files
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do you write a file?

I'm getting:

Quote:IOError: (22, "invalid mode ('w') or filename", 'special://profile/addon_data/my.addon/test.txt')

I'm using:

Code:
text_file = open('special://profile/addon/addon_data/my.addon/test.txt', "w+")
text_file.write("hello")
text_file.close()
you cannot use python fileio on vfs paths. pass the path through xbmc.translatePath() first.
(2016-01-12, 15:44)ironic_monkey Wrote: [ -> ]you cannot use python fileio on vfs paths. pass the path through xbmc.translatePath() first.

Thanks, it's working now.