Skip to content

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

Closed
@Mng12345

Description

@Mng12345

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions