versionFile = Core.storage.join_path(Core.bundle_path, 'Contents', 'Resources', 'test.txt')
# suggest using with statement, will handle closing for you
with io.open(versionFile, 'wb') as f:
f.write('test')
Also it’s a good idea to expand relative paths by using Core.storage.abs_path(), YMMV.
On a side note, the Plex Framework does include a Datakit which allows the developer to read and write raw binary files or objects into the channels support directory. More info on the Datakit can be found in PlexPlug-inFramework.pdf, page 78.
Bonus: Another developer asked me about general channel development the other day. I compiled a small list of resources for them and thought you might find it useful too. Refer to Comment_1324842.
versionFile = Core.storage.join_path(Core.bundle_path, 'Contents', 'Resources', 'test.txt')
# suggest using with statement, will handle closing for you
with io.open(versionFile, 'wb') as f:
f.write('test')
Also it’s a good idea to expand relative paths by using Core.storage.abs_path(), YMMV.
On a side note, the Plex Framework does include a Datakit which allows the developer to read and write raw binary files or objects into the channels support directory. More info on the Datakit can be found in PlexPlug-inFramework.pdf, page 78.
Bonus: Another developer asked me about general channel development the other day. I compiled a small list of resources for them and thought you might find it useful too. Refer to Comment_1324842.
thank you for weighing in on this; your reference to the Datakit also works and I did not know about it.
thank you for the additional documentation as well, seems I have a lot of casual reading ahead of me.