Add a quick format option for mkfat32

Added open implementation

Needed to return a pointer to the file system as `@fieldParentPtr(Fat32Self, "instance", fs.instance)` doesn't work as the the pointer to `instance` is on the stack, then goes out of scope when the init is returned. So will be using free stack space.
Part of #216

Spelling, doc comments and extra test for open file


init -> create, deinit -> destroy
This commit is contained in:
DrDeano 2020-12-07 18:29:16 +00:00
parent 48e0779d84
commit d5de173fd3
No known key found for this signature in database
GPG key ID: 96188600582B9ED7
4 changed files with 419 additions and 60 deletions

View file

@ -217,7 +217,7 @@ const Fat32BuilderStep = struct {
// If there was an error, delete the image as this will be invalid
errdefer (std.fs.cwd().deleteFile(self.out_file_path) catch unreachable);
defer image.close();
try Fat32.make(self.options, image);
try Fat32.make(self.options, image, false);
}
///