Skip to content

The lock file should be closed after opening it with openSync #5620

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

Closed
Mng12345 opened this issue Aug 30, 2022 · 0 comments · Fixed by #5621
Closed

The lock file should be closed after opening it with openSync #5620

Mng12345 opened this issue Aug 30, 2022 · 0 comments · Fixed by #5621

Comments

@Mng12345
Copy link

https://github.com/rescript-lang/rescript-compiler/blob/432c513fee1bb4aeb04c7ceddde003a18cfc9818/rescript#L194
This code will not delete the lock file on Windows as the lock file is not closed.

const fs = require('fs');
let fId = fs.openSync('fk.lock', 'wx', 0o664);
fs.unlinkSync('fk.lock')

We should close it before deleting.

const fs = require('fs');
let fId = fs.openSync('fk.lock', 'wx', 0o664);
fs.closeSync(fId);
fs.unlinkSync('fk.lock');

This caused the build error on Windows.

@Mng12345 Mng12345 changed the title The lock file should be closed after use open it with openSync The lock file should be closed after opening it with openSync Aug 30, 2022
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 a pull request may close this issue.

1 participant