Skip to content

Temporary file/directory support #1540

@heinezen

Description

@heinezen

Required Skills: Python or C++

Difficulty: Easy

It would be nice if we could create temporary files/directories in our current file system abstraction API. We currently only use temporary structures in the converter, but they could be useful in other places, e.g. for unzipping archives or on-disk caching.

Creation of temporary files could be implemented in our Python file API or our C++ file API or in both. The Python-side implementation is more preferrable at the moment, since the converter is written Python and temporary files already have an active use case there.

The easiest way to implement support probably is to add a method that calls the underlying system libraries for temporary file/directory creation:

  • Python: tempfile module
  • C++: std::filesystem and std::tmpfile

The retrieved path is then wrapped in our Path/Directory classes and returned by the method.

Tasks:

  • Create temp file/dir and wrap them in openage file system API (Python)
  • Create temp file/dir and wrap them in openage file system API (C++)
  • Delete temp file/dir explicitely when object is destroyed
  • Use new implementation in code (currently only in converter)
  • (optional) Add method for checking if a file/dir is temporary

Further Reading

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: assetsInvolved with assets (images, sounds, ...)good first issueSuitable for newcomerslang: c++Done in C++ codelang: pythonDone in Python codenice new thing ☺A new feature that was not there before

    Projects

    Status

    🔖 TODO

    Status

    converter

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions