Skip to main content

A small library for Windows to queue files to be moved, deleted, or renamed on reboot.

Project description

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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

movefile-restart-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

movefile_restart-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file movefile-restart-1.0.0.tar.gz.

File metadata

  • Download URL: movefile-restart-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for movefile-restart-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2fe877bf236c1daf2e357447e371dcc50d1f225b11630787c2c02c524507182b
MD5 f70b13e661b06cad320b5745cc43cd82
BLAKE2b-256 0b02739c19b7af99ebf45f495b4f04d28647de0351a40dd7c3bb4ede6dce2e6c

See more details on using hashes here.

Provenance

File details

Details for the file movefile_restart-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: movefile_restart-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for movefile_restart-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a693b3e26eeaabbf969cb3d1f5444235004767c4a36b207b94168fcbae8dd263
MD5 0f3935c3fb813f2427db8406ede9e32a
BLAKE2b-256 cdc125bbc8c9905f2e30e7000f207a9e65f2295235fad621c5931dd392bf767e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page