aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-opfs-async-proxy.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/api/sqlite3-opfs-async-proxy.js')
-rw-r--r--ext/wasm/api/sqlite3-opfs-async-proxy.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.js b/ext/wasm/api/sqlite3-opfs-async-proxy.js
index cafd296c6..58b8bcb23 100644
--- a/ext/wasm/api/sqlite3-opfs-async-proxy.js
+++ b/ext/wasm/api/sqlite3-opfs-async-proxy.js
@@ -562,6 +562,17 @@ const installAsyncProxy = function(self){
wTimeEnd();
return;
}
+ if( state.opfsFlags.OPFS_UNLINK_BEFORE_OPEN & opfsFlags ){
+ //log("async proxy opfsFlags =",opfsFlags);
+ try{
+ await hDir.removeEntry(filenamePart);
+ //log("Unlinked",filename,hDir,filenamePart);
+ }
+ catch(e){
+ /* ignoring */
+ //warn("Ignoring failed Unlink of",filename,":",e);
+ }
+ }
const hFile = await hDir.getFileHandle(filenamePart, {create});
wTimeEnd();
const fh = Object.assign(Object.create(null),{