isaacs / node-tar

tar for node
ISC License
837 stars 183 forks source link

After using node-tar to read a specific file in the tar package, the file cannot be deleted by fs.unlinkSync immediately. #404

Closed leoFitz1024 closed 6 months ago

leoFitz1024 commented 6 months ago

Node.js version: v20.3.1 node-tar: ^6.2.1

Specific reproducible test code repository: https://github.com/leoFitz1024/test-node-tar

I encountered a strange phenomenon. When the tar file is large, after using node-tar to read a specific file in the tar package, it cannot be immediately deleted using fs.unlinkSync. It is only truly deleted after the program exits, while this issue does not occur in smaller tar files.

leoFitz1024 commented 6 months ago

image It might be an issue here,This can solve it