You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems related to #23. If oldFilepath and newFilepath are equal, then the file is deleted; I'm not sure if this is the default node fs behavior, but we can see this is because the old file is deleted after the new file is inserted here:
rename(oldFilepath,newFilepath){letbasename=path.basename(newFilepath);// Note: do both lookups before making any changes// so if lookup throws, we don't lose data (issue #23)// grab referencesletentry=this._lookup(oldFilepath);letdestDir=this._lookup(path.dirname(newFilepath));// insert into new parent directorydestDir.set(basename,entry);// remove from old parent directorythis.unlink(oldFilepath)}
A simple fix would be to check for that condition, and return without doing anything:
This seems related to #23. If
oldFilepath
andnewFilepath
are equal, then the file is deleted; I'm not sure if this is the default node fs behavior, but we can see this is because the old file is deleted after the new file is inserted here:A simple fix would be to check for that condition, and return without doing anything:
The text was updated successfully, but these errors were encountered: