Skip to content

CODECS with Temporary files using tempfile.mkdtemp() enabling multiple processing. #40

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

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

Conversation

kny5
Copy link

@kny5 kny5 commented Mar 15, 2025

For the issue of multiple processes overwriting temporary codec files at /tmp/.
Placing temporary codec files like: "temp_dxf.dxf" inside a directory created using tempfile.mkdtemp().
Ensuring, no io file bottlenecks, racing conditions or unwanted overwriting happens while using tools like,
cadorchestrator server and nimble, or any other bulk multiple processing.

A class temp_dir was created with the methods:

init for initialisation and creation of the directory, and dlt for safely removing the path and directory if needed.

…file conditions for multiple parallel processing.
@jmwright
Copy link
Member

Thanks @kny5 ! The FreeCAD failure is not your doing. It's failing in another current PR too. It does look like there is a lint issue though.

self.path = tempfile.mkdtemp()
logging.debug(f"temp_dir: {self.path}")

def dlt(self):
Copy link
Member

Choose a reason for hiding this comment

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

Is dlt called anywhere? Maybe you want __del__ instead so it's called when the temp_dir is deconstructed?

@jmwright
Copy link
Member

@kny5 If you merge master into your branch it should fix the FreeCAD test.

@jmwright
Copy link
Member

jmwright commented Apr 7, 2025

Closes #39

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.

3 participants