From 1f20565471ec038d636af2774e103b1ff45c27be Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Thu, 1 Jun 2023 00:30:34 -0300 Subject: [PATCH] Allows CLOSE to be called without parameters CLOSE should invalidate all open handles when called with no parameters; --- qb.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qb.js b/qb.js index eceac3a..eab093e 100644 --- a/qb.js +++ b/qb.js @@ -1064,6 +1064,12 @@ var QB = new function() { }; this.sub_Close = function(fh) { + if (!fh) { + for (const key in _fileHandles) { + delete _fileHandles[key]; + } + return; + } if (!_fileHandles[fh]) { throw new Error("Invalid file handle"); }