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

Uncaught Error: EMFILE: too many open files, open #4

Closed
niravjgandhi opened this issue Jul 17, 2015 · 1 comment
Closed

Uncaught Error: EMFILE: too many open files, open #4

niravjgandhi opened this issue Jul 17, 2015 · 1 comment

Comments

@niravjgandhi
Copy link

Hello All.

     I am trying to encrypt almost 10000+ file in a row using following function.
     It gives error something like:
     ## Uncaught Error: EMFILE: too many open files, open 'bun.ogg' 

Source code is given bellow.

     function copyRecursiveSync(src, dest) {
var exists = fs.existsSync(src);
var stats = exists && fs.statSync(src);
var unSelectedArray = getUnSelectedOptionArray();
var isDirectory = exists && stats.isDirectory();
if (exists && isDirectory) {
    var destExist = fs.existsSync(dest);
    if (!destExist)
        fs.mkdirSync(dest);
    fs.readdirSync(src).forEach(function (childItemName) {
        copyRecursiveSync(path.join(src, childItemName),
            path.join(dest, childItemName));
    });
} else {

    var splitArray = src.split(".");

    if (isFileEncrypt(splitArray[1], unSelectedArray) === true) {
        encryptor.encryptFile(src, dest, secrateKey, options, function (err) {});

    } else {
        fs.linkSync(src, dest);
    }
}

}

Please help me to solve this. I am very new in this technology.
     Any Other solution for doing this is also excepted. 
@tzmanics
Copy link
Contributor

Hi @niravjgandhi sorry for the delay. We aren't currently maintaining this repo so I'm going to close this issue for now, but please re-open it if you are still dealing with this issue.

Thank you!

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

2 participants