From 71d513a65ec920149f70a51811677a7485d04262 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sat, 11 Nov 2023 17:49:16 +1000 Subject: [PATCH] touch used on an unloaded remote file should load the file --- clite/commands.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/clite/commands.js b/clite/commands.js index 8067bca..a4f709a 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -231,9 +231,18 @@ Options: return 1; } + function loadRemote(fd) { + if (!fd) { + io.error('unable to create file: '+file); + io.exit(1); + return; + } + io.exit(0); + } + if (!stdio.creat(file)) { - io.error('unable to create file: '+file); - return 1; + var fd = stdio.open(file,loadRemote); + return null; } return 0;