File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,19 @@ function should_retry_link_unlink(err) {
289289 return should_retry_general || should_retry_gpfs || should_retry_posix ;
290290}
291291
292+ /**
293+ * stat_ignore_enoent unlinks a file and if recieved an ENOENT error it'll not fail
294+ * @param {nb.NativeFSContext } fs_context
295+ * @param {string } file_path
296+ * @returns {Promise<nb.NativeFSStats> }
297+ */
298+ async function stat_ignore_enoent ( fs_context , file_path ) {
299+ try {
300+ return await nb_native ( ) . fs . stat ( fs_context , file_path ) ;
301+ } catch ( err ) {
302+ if ( err . code !== 'ENOENT' ) throw err ;
303+ }
304+ }
292305
293306/**
294307 * stat_if_exists execute stat on entry_path and ignores on certain error codes.
@@ -729,6 +742,7 @@ exports.finally_close_files = finally_close_files;
729742exports . get_user_by_distinguished_name = get_user_by_distinguished_name ;
730743exports . get_config_files_tmpdir = get_config_files_tmpdir ;
731744exports . stat_if_exists = stat_if_exists ;
745+ exports . stat_ignore_enoent = stat_ignore_enoent ;
732746
733747exports . _is_gpfs = _is_gpfs ;
734748exports . safe_move = safe_move ;
You can’t perform that action at this time.
0 commit comments