python-movefile-restart
A small library to move, delete, and rename files at Windows restart time.
Installation
pip install movefile-restart or pip3 install movefile-restart, depending on your configuration of Python and Pip.
Usage
To import, use import movefile_restart
From there, you have a couple functions at your disposal:
movefile_restart.DeleteFile(file_path, check_conflicts=True): Queues file_path for deletion.*
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.*
movefile_restart.GetFileOperations(): Get a list of tuples containing the source and destination of all file movings queued.
movefile_restart.PrintFileOperations(): Print a list of file operations that are scheduled to occur during reboot.
movefile_restart.RemoveFileOperation(file_op_index): Remove a file operation based on its index from movefile_restart.GetFileOperations().
movefile_restart.CheckPermissions(): Check for read/write permissions to the registry keys needed for this library.
*: 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.
Current Limitations
- Due to using the Windows Registry for handling these kinds of operations, no other operating system is supported, nor is there planned support.
- 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).
Metadata
Release files for movefile-restart 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| movefile-restart-1.0.1.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| movefile_restart-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / movefile-restart-1.0.1.tar.gz
| Download URL | movefile-restart-1.0.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee2cbe8ea0eba41006da56ef89d53d3b5c82239d9054f37f3fa011775e886f12
|
|
BLAKE2b-256 checksum How to use checksums |
8fb868235e155795df484c8afde60c605761af887a583fcf1580fc074adad7be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6
|
Release files / movefile_restart-1.0.1-py3-none-any.whl
| Download URL | movefile_restart-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c67272a209484635400a6afc83476a80740954c8dc8d1b08c6caa7706e836bbb
|
|
BLAKE2b-256 checksum How to use checksums |
953618cff07edba3116126a5549f6e3c6d4c5e8d392cf82eaddac630f6ac2e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6
|