Use comptime for fully declarative LV2 and Custom commands #14

Merged
luna merged 69 commits from declarative-commands into master 2020-06-02 21:37:47 +00:00
Showing only changes of commit 0240b10a3c - Show all commits

View file

@ -95,12 +95,16 @@ pub fn temporaryName(allocator: *std.mem.Allocator) ![]u8 {
}
// if we fail to access it, we assume it doesn't exist and return it.
_ = std.fs.cwd().openFile(nam, .{ .read = true, .write = false }) catch |err| {
if (err == error.FileNotFound) {
return nam;
}
var tmp_file: std.fs.File = std.fs.cwd().openFile(
nam,
.{ .read = true, .write = false },
) catch |err| blk: {
if (err == error.FileNotFound) return nam else continue;
};
// if we actually found someone, close the handle so that we don't
// get EMFILE later on.
tmp_file.close();
}
return error.TempGenFail;