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
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -12,18 +12,21 @@ To import, use `import movefile_restart`
12
12
13
13
From there, you have a couple functions at your disposal:
14
14
15
-
`movefile_restart.DeleteFile(file_path)`: Queues `file_path` for deletion.
15
+
`movefile_restart.DeleteFile(file_path, check_conflicts=True)`: Queues `file_path` for deletion.*
16
16
17
-
`movefile_restart.MoveFile(from_path, to_path)` or `movefile_restart.RenameFile(from_path, to_path)`: Moves the file from `from_path` to `to_path`.
17
+
`movefile_restart.MoveFile(from_path, to_path, check_conflicts=True)` or `movefile_restart.RenameFile(from_path, to_path)`: Moves the file from `from_path` to `to_path`.*
18
18
19
19
`movefile_restart.GetFileOperations()`: Get a list of tuples containing the source and destination of all file movings queued.
20
20
21
21
`movefile_restart.PrintFileOperations()`: Print a list of file operations that are scheduled to occur during reboot.
22
22
23
+
`movefile_restart.RemoveFileOperation(file_op_index)`: Remove a file operation based on its index from `movefile_restart.GetFileOperations()`.
24
+
23
25
`movefile_restart.CheckPermissions()`: Check for read/write permissions to the registry keys needed for this library.
24
26
27
+
*: For both of these functions, the `check_conflicts` parameter determines whether or not to perform checks when moving/deleting to make sure if it can be performed successfully in the case of a conflict. It only checks if there is initially a problem (the file being deleted doesn't exist, the source of the file being moved doesn't exist, or the destination file of a move already exists). Setting `check_conflicts` to False when calling these functions will skip all of these checks.
28
+
25
29
## Current Limitations
26
30
27
-
* Files cannot currently be un-queued.
28
-
* Some weird cases such as: if you're moving `a.txt` to `b.txt`, you cannot queue a deletion for `b.txt` after your file move queue. You would have to restart the computer so `b.txt` exists before deleting it.
29
-
* Due to using the Windows Registry for handling these kinds of operations, no other operating system is supported, nor is there planned support.
31
+
* Due to using the Windows Registry for handling these kinds of operations, no other operating system is supported, nor is there planned support.
32
+
* Some cases can occur where a move/delete can fail. For example, queueing a deletion of file A then queueing a move from file A to file B isn't currently checked for, and will result in the move not occuring (as file A will be deleted before it can be moved).
0 commit comments