mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-29 19:47:49 +00:00
use shutil.move instead of os.rename to move file
This prevents a "OSError: [Errno 18] Invalid cross-device link" if the temporary file was created on different filesystem (such as a tmpfs mount).
This commit is contained in:
parent
8ed63b27be
commit
ba250a3075
@ -73,7 +73,7 @@ def changefile(from_prefix, to_prefix, from_path, to_path, *,
|
||||
shutil.copystat(from_path, to_path)
|
||||
|
||||
if to_path_temp:
|
||||
os.rename(to_path, from_path)
|
||||
shutil.move(to_path, from_path)
|
||||
elif from_path != '-':
|
||||
os.remove(from_path)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user