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

'Solution' #799

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

Conversation

Hulk-hurry-Hulk-smash
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the file moving functionality! 🎉 Your code meets the task requirements and handles command parsing, file existence checks, and directory creation effectively. While it works well, consider adding checks to ensure the source isn't a directory and that the destination isn't the same as the source. These enhancements will make your code even more robust. Keep up the great work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

if not os.path.isfile(source):
raise FileNotFoundError(f"Source file '{source}' does not exist.")

if destination.endswith("/"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a check to ensure that the destination is not the same as the source. Moving a file to itself should raise an error to prevent unnecessary operations.


source, destination = args[1], args[2]

if not os.path.isfile(source):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be beneficial to check if the source is a directory and raise an error if so, as this function seems intended for files only.

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.

2 participants