-
Notifications
You must be signed in to change notification settings - Fork 184
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
system: delete_file
#966
base: master
Are you sure you want to change the base?
system: delete_file
#966
Conversation
Hi @perazz thanks for this PR! Regarding the naming, I think it will depend indeed on the functionality. If deleting folders is also included then it could be Another possibility would be to leave this procedure for deleting only single files and then add another procedure for deleting a whole folder tree I think that it makes sense to leave it in the |
I agree with your opinion: all OSes have a similar differentiation between 3 options basically:
So I think it makes sense to have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @perazz . LGTM. I only have a minor question regarding its behaviour. I wonder if it should raise a warning, instead of an error, if the file does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @perazz Thanks for this nice addition!
This PR is spun off #904 for clarity.
The
delete_file
subroutine removes a file from the filesystem.The function ensures the file exists and is not a directory before attempting deletion.
If deletion fails due to permissions, being a directory, or other issues, an error is raised.
Some questions to discuss:
delete
,delete_file
, or another name?stdlib_system
orstdlib_io
, or elsewhere?cc: @jvdp1 @jalvesz