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

Cleanup temp files #5

Open
durzo opened this issue Jul 10, 2020 · 1 comment
Open

Cleanup temp files #5

durzo opened this issue Jul 10, 2020 · 1 comment

Comments

@durzo
Copy link

durzo commented Jul 10, 2020

This plugin does not clean up the temporary files it makes, leaving $CFG->tempdir an absolute mess at the root level.

It would be good idea to use make_request_directory() rather than write directly to $CFG->tempdir, as it will get automatically removed by the shutdown handler.

@ecampbell
Copy link
Owner

Fair point, I've released v3.6.3 to stop leaving any temporary files lying around. I just realised that tempnam() actually creates the file, and I was renaming the returned filename for debugging purposes, which meant that the original created file was never deleted. I didn't use make_request_directory() yet, but it's a good suggestion and I'll incorporate it in the next major release, if I can figure out a way to keep the temporary files when debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants