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

Delete working directory error #385

Open
LittleSnailzs opened this issue Aug 21, 2024 · 6 comments
Open

Delete working directory error #385

LittleSnailzs opened this issue Aug 21, 2024 · 6 comments

Comments

@LittleSnailzs
Copy link

Hello, I have encountered a problem
I have called NodeRuntime.close(), but the path corresponding to the working directory still cannot be deleted

@caoccao
Copy link
Owner

caoccao commented Aug 21, 2024

I think you'd better chdir to somewhere else before doing so.

@lilithyang2018
Copy link

const path = require('path');
const { chdir, cwd } = require('process');

const rootDir = cwd();
try {
  ...
} finally {
    chdir(path.dirname(rootDir));
}

@caoccao like this ?

@caoccao
Copy link
Owner

caoccao commented Aug 23, 2024

Something like that.

@lilithyang2018
Copy link

@caoccao it seems that the V8FileExecutor does not release the js file after NodeRuntime is closed, so the file is always occupied by the java process. any suggestions ?

@caoccao
Copy link
Owner

caoccao commented Aug 26, 2024

It's quite unusual to delete the script. Please use the other executors instead.

@lilithyang2018
Copy link

ok, i'll try V8StringExecutor instead

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

No branches or pull requests

3 participants