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
ShellJS: internal error Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys' #514
Comments
Could something like this be an approach? function pushFile(abs, relName, stat) {
if (process.platform === 'win32') {
relName = relName.replace(/\\/g, '/');
}
if (options.long) {
try {
stat = stat || fs.lstatSync(abs);
} catch (e) {
console.log(e.code)
stat = {}
} finally {
list.push(addLsAttributes(relName, stat));
}
} else {
// list.push(path.relative(rel || '.', file));
list.push(relName);
}
} It's done fast, not a real solution at all. Problem with this is you need to test for any function if it exists or not, and doesn't specify that a file was locked. Any ideas? Kind to make a PR for this when agree on the approach :) |
Temporary solution for shelljs#514 Adds the 'locked' attribute when file cannot be accessed.
For that, changed shelljs to use my fork with a temporary solution for shelljs/shelljs#514
@bertofer Sorry, I didn't notice this until now! It looks to me like we don't have permission to read that file? Why would that be? I'm not opposed to this as a PR if it's the best approach. If there's a way we can stat the file, that would be even better. Some points:
|
Closing this, since we don't officially support electron. I see that some ASAR stuff is mentioned, perhaps you might find a suitable workaround in our wiki page. |
Node version (or tell us if you're using electron or some other framework):
4.3.1, using electron
ShellJS version (the most recent version/Github branch you see the bug on):
0.7.2
Operating system:
Windows 10
Description of the bug:
When trying to ls on C:, it fires the following error:
Example ShellJS command to reproduce the error:
The text was updated successfully, but these errors were encountered: