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] tempfile and tempdir #2352

Open
wants to merge 9 commits into
base: nightly
Choose a base branch
from

Conversation

artemiogr97
Copy link
Contributor

Implementation for #2018

@artemiogr97 artemiogr97 changed the title Tempfile-and-tempdir [stdlib] tempfile and tempdir Apr 20, 2024
@artemiogr97
Copy link
Contributor Author

artemiogr97 commented Apr 20, 2024

I opened the pull to have some feedback, some points to discuss:

  • Are the read methods useful in NamedTemporaryFile?
    • personally I don't know in which case I would create a temporary file and read from it at the same time
  • should I implement what I need in the os module directly in this pull ?
    • TemporaryDirectory is not implemented yet because os.mkdir and os.rmdir don't exist, I guess shutil.rmtree will be necessary too (implemented in [stdlib] Implement mkdir and rmdir #2430 and [stdlib] Implementation of rmtree #2439)
    • For NamedTemporaryFile there is a slight difference with respect to the python implementation, the name attribute could end up being relative but the functions os.abspath, and os.normpath still don't exist
      • also how different platforms are going to be handled in mojo, in python there are dedicated modules posix and ntpath, I guess the same should be done in mojo?

Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
@artemiogr97 artemiogr97 force-pushed the tempfile-and-tempdir branch 2 times, most recently from a0b40cc to a8d1ea3 Compare April 28, 2024 13:05
Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
Signed-off-by: Artemio Garza Reyna <artemiogr97@gmail.com>
@artemiogr97
Copy link
Contributor Author

#2439 must be merged first

@artemiogr97 artemiogr97 marked this pull request as ready for review May 4, 2024 09:32
@artemiogr97 artemiogr97 requested a review from a team as a code owner May 4, 2024 09:33
@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
mojo-repo Tag all issues with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants