Windows apps installed via .appx may be installed to any drive the user chooses. From what I understand, when an appx application is executed, the file system is virtualized; Windows lies to the application about where it is running from, and when the application accesses a file, Windows proxies the calls across from the virtualized location to the actual location.
Example: if Windows is installed on C:, I can install an AppX application on D:. When the application is launched, Windows will the application CWD will be C:\Users\David\AppData\Roaming\{AppName} instead of somewhere on the D: drive.
(note: I could be wrong about what Windows is really doing here!)
All that to say... the following call to fs.renameSync may fail with a cross-device link not permitted error. I wish Windows would handle this internally, as this really seems more like a Windows bug than bug in write-file-atomic to me.
|
fs.renameSync(tmpfile, filename) |
A potential solution may be to first try the rename, then try a copy + delete operation if that rename fails.
related issue: ConsenSys-archive/ganache-ui#1943
Windows apps installed via
.appxmay be installed to any drive the user chooses. From what I understand, when an appx application is executed, the file system is virtualized; Windows lies to the application about where it is running from, and when the application accesses a file, Windows proxies the calls across from the virtualized location to the actual location.Example: if Windows is installed on
C:, I can install an AppX application onD:. When the application is launched, Windows will the application CWD will beC:\Users\David\AppData\Roaming\{AppName}instead of somewhere on theD:drive.(note: I could be wrong about what Windows is really doing here!)
All that to say... the following call to
fs.renameSyncmay fail with across-device link not permittederror. I wish Windows would handle this internally, as this really seems more like a Windows bug than bug in write-file-atomic to me.write-file-atomic/index.js
Line 244 in eb8dff1
A potential solution may be to first try the rename, then try a
copy+deleteoperation if that rename fails.related issue: ConsenSys-archive/ganache-ui#1943