-
Notifications
You must be signed in to change notification settings - Fork 47
Description
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.
Line 244 in eb8dff1
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: trufflesuite/ganache-ui#1943