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

[stdlib] Implement os.remove and os.unlink #2306

Closed
1 task done
artemiogr97 opened this issue Apr 15, 2024 · 4 comments
Closed
1 task done

[stdlib] Implement os.remove and os.unlink #2306

artemiogr97 opened this issue Apr 15, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library

Comments

@artemiogr97
Copy link
Contributor

Review Mojo's priorities

What is your request?

Implement functions to delete files os.remove and os.unlink

What is your motivation for this change?

These features are still missing in standard library

Any other details?

No response

@artemiogr97 artemiogr97 added enhancement New feature or request mojo Issues that are related to mojo labels Apr 15, 2024
@artemiogr97
Copy link
Contributor Author

I have a branch with a prototype, I'm adding some tests to create the PR

@Moosems
Copy link

Moosems commented Apr 16, 2024

Is there a secondary issue for file creation (touch filename.ext / cop nul > filename.ext)?

@artemiogr97
Copy link
Contributor Author

I don't think so, but there is not a "touch" function in python, so I don't know if it is needed in mojo, in python to create a file you do

file = open("my_file")
file.close()

or you use a context manager, you can already do the same in mojo

@ematejska ematejska added the mojo-stdlib Tag for issues related to standard library label Apr 18, 2024
JoeLoser pushed a commit that referenced this issue Apr 19, 2024
Add `os.remove` and `os.unlink` functions.

Fixes #2306

---------

Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
@JoeLoser
Copy link
Collaborator

Fixed with 20737dc, thank you for the contribution @artemiogr97! 🎉

patrickdoc added a commit that referenced this issue May 2, 2024
…370)

Add `os.remove` and `os.unlink` functions.

Fixes #2306

---------

Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>

mojo-orig-commit: 20737dc

Co-authored-by: artemiogr97 <57588855+artemiogr97@users.noreply.github.com>
MODULAR_ORIG_COMMIT_REV_ID: 2fe3ba9cb40bc5955131de5bca317aae3819e365
@ematejska ematejska added the mojo-repo Tag all issues with this label label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mojo Issues that are related to mojo mojo-repo Tag all issues with this label mojo-stdlib Tag for issues related to standard library
Projects
None yet
Development

No branches or pull requests

4 participants