MAK-Relic-Tool / Issue-Tracker

Central Bug Tracker / Issues Board for the MAK Relic Tool
0 stars 0 forks source link

EssenceFS does not save changes when writing/creating #36

Open ModernMAK opened 1 year ago

ModernMAK commented 1 year ago

EssenceFS never calls a serializer to save changes to disk when in write or create mode.

This requires the user to manually save the filesystem using a serializer.

E.G.


with open_fs("sga://somepath.sga") as sga:
    ... # Some writes to the 'sga' object's filesystem
    with open(outfile, "wb") as sga_file:
        v2_serializer.write(sga_file, sga)

Preferably, this would be condensed to the snippet below, using PyFilesystem's __exit__() and close() methods.


with open_fs("sga://somepath.sga") as sga:
    ... # Some writes to the 'sga' object's filesystem

Unfortunately, we would need to cover the case where essence-fs is created manually, as there is no underlying file to write to


with EssenceFS() as sga:
    ... # Some writes to the 'sga' object's filesystem