Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved script and added functionality #404

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SaeedAnsari05
Copy link

@SaeedAnsari05 SaeedAnsari05 commented Feb 16, 2025

PR Title

Enhance FileOrganizer.py with Error Handling, Duplicate File Handling, and Directory Skipping

Summary

Improved the FileOrganizer.py script by adding error handling, skipping directories, handling files without extensions, and preventing duplicate file overwrites.

Description

This PR improves the existing file organization script by making it more robust and efficient.
Key enhancements include:

Checking if the user-specified directory exists before proceeding.
Ignoring directories to prevent accidental movement.
Handling files without extensions by placing them in a NoExtension folder.
Avoiding overwriting duplicate files by renaming them instead.

The changes are as follows:

Added error handling to check if the directory exists before executing.
Skipped directories to ensure only files are moved.
Handled files without extensions by moving them to a NoExtension folder.
Prevented file overwriting by appending a counter (e.g., file1.txt → file1_1.txt).
Refactored file paths for better readability and efficiency.

Checks

in the repository

  • Made no changes that degrades the functioning of the repository
  • Gave each commit a better title (unlike updated README.md)

in the PR

  • Followed the format of the pull_request_template
  • Made the Pull Request in a small level (for the creator's wellfare)
  • Tested the changes you made

Thank You,

Saeed Ansari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant