Skip to content

Collect all temporary files in a temporary directory #1779

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
4 of 15 tasks
sterretjeToo opened this issue Dec 18, 2022 · 4 comments
Open
4 of 15 tasks

Collect all temporary files in a temporary directory #1779

sterretjeToo opened this issue Dec 18, 2022 · 4 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@sterretjeToo
Copy link

sterretjeToo commented Dec 18, 2022

Describe the request

IDE 2.0 leaves a lot of directories files behind in (Windows system) C:\Users\yourUsername\AppData\Local\Temp. Request to collect them all in one dedicated Arduino directory.

If the cause is a virus scanner that prevents cleanup, it's safer to just exclude on directory instead of the complete directory.
If the cause is Windows or the IDE, it's easier to manually clean up at occasion.

Describe the current behavior

Directories and files that can be found in C:\Users\yourUsername\AppData\Local\Temp

Arduino IDE version

arduino-ide_nightly-20221217_Windows_64bit

Operating system

Windows

Operating system version

Win10 Home

Additional context

Above list from IDE 2.0.3; I haven't consistently used the nightly build to be sure if the list has not changed significantly but a number of the above directories and files are certainly there.

Additional Requests

Related

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@sterretjeToo sterretjeToo added the type: enhancement Proposed improvement label Dec 18, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Dec 18, 2022
@kittaakos
Copy link
Contributor

kittaakos commented Dec 19, 2022

This is a great idea. However, besides these, 👇 IDE2 does not create any files, but the CLI, the LS, the debugger, etc., manage them.

  • Files C:\Users\yourUsername\AppData\Local\Temp\.arduinoIDE-unsaved*.
  • Directories C:\Users\yourUsername\AppData\Local\Temp\longNumber\arduino-ide2-longHexNumber; directories are empty

@sterretjeToo
Copy link
Author

@kittaakos and @per1234

As I don't know what is all involved, I'll leave it up to you guys to add similar feature requests for all the other applications in the tool chain ;)

@kittaakos kittaakos self-assigned this Dec 20, 2022
@wh201906
Copy link
Contributor

I guess the .arduinoIDE-unsaved* is created by Arduino IDE?

/**
* Creates a temp folder and returns with a promise that resolves with the canonicalized absolute pathname of the newly created temp folder.
* This method ensures that the file-system path pointing to the new temp directory is fully resolved.
* For example, on Windows, instead of getting an [8.3 filename](https://en.wikipedia.org/wiki/8.3_filename), callers will get a fully resolved path.
* `C:\\Users\\KITTAA~1\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2022615-21100-iahybb.yyvh\\sketch_jul15a` will be `C:\\Users\\kittaakos\\AppData\\Local\\Temp\\.arduinoIDE-unsaved2022615-21100-iahybb.yyvh\\sketch_jul15a`
*/
private createTempFolder(): Promise<string> {
return new Promise<string>((resolve, reject) => {
temp.mkdir({ prefix: TempSketchPrefix }, (createError, dirPath) => {
if (createError) {
reject(createError);
return;
}
realpath.native(dirPath, (resolveError, resolvedDirPath) => {
if (resolveError) {
reject(resolveError);
return;
}
resolve(resolvedDirPath);
});
});
});
}

@per1234

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

4 participants