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

Issue with fs.readFileand fs.unlink #7368

Closed
SteveyPugs opened this issue Jun 22, 2016 · 1 comment
Closed

Issue with fs.readFileand fs.unlink #7368

SteveyPugs opened this issue Jun 22, 2016 · 1 comment
Labels
fs Issues and PRs related to the fs subsystem / file system.

Comments

@SteveyPugs
Copy link

Version: v0.12.14
Platform: Windows 7 x64
Subsystem: N/A

I am trying to read files and remove them using chokidar and async.

The issue that happens that once every couple of files I get these errors

error:  Error: EBUSY, open 'FILENAME'
    at Error (native)

{ [Error: EBUSY, unlink 'FILENAME']
  errno: -4082,
  code: 'EBUSY',
  path: 'FILENAME' }

Here is short breakdown of my code

chokidar.watch("FOLDERNAME",{
    persistent: true
}).on("add", function(filepath){
    queue.push(filepath, function(err, results){
        if(err) logger.error(err);
        fs.unlink(filepath, function(err){
            if(err) console.error(err);
        });
    });
});

var queue = async.queue(function(filepath, callback){
    fs.readFile(filepath, function(err, fileData){
        // blah process
    });
}, 1);

Any insight or direction would be helpful. Thanks!

P.S. - I am not sure I opened the issue correctly regarding the guidelines so I apologize ahead of time.

@SteveyPugs SteveyPugs changed the title Issue with fs.ReadFile and fs.unLink Issue with fs.readFileand fs.unlink Jun 22, 2016
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Jun 22, 2016
@cjihrig
Copy link
Contributor

cjihrig commented Jun 22, 2016

Can you try asking this question at https://github.com/nodejs/help. If it turns out to be an actual issue with Node core, we can revisit this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

No branches or pull requests

3 participants