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

Fix permissions error (EPERM) on Windows #159

Closed
wants to merge 2 commits into from
Closed

Fix permissions error (EPERM) on Windows #159

wants to merge 2 commits into from

Conversation

ArtskydJ
Copy link

The dotfile was getting permissions errors on windows.

This fixes the issue by buffering in memory rather than writing to a dotfile.

Memory usage was similar in my tests. (Write to dotfile: 42k, Buffer in memory: 42-44k.)

Fixes #83.

Related: #103, #104, #156.

added missing semicolons
fixed mixed tabs/spaces
shortened code
@ghost
Copy link

ghost commented Mar 21, 2015

It would be good to know why this seems to fix the issue. Buffering up the contents sounds like it might be more related to a timing issue than the sequence of operations on disk.It looks like fs.watch() has problems on windows generating spurious EPERMs: nodejs/node-v0.x-archive#3250 nodejs/node-v0.x-archive#4337 Some of the issues seem to suggest the error can just be ignored or it might work to just unregister

@ghost
Copy link

ghost commented Mar 21, 2015

What happens in windows when:

    wb.pipe(fs.createWriteStream(dotfile));

is changed to:

    wb.pipe(fs.createWriteStream(outfile));

with the fs.renae() part removed?

@ArtskydJ
Copy link
Author

Writing straight to the outfile works great. PR here: #161

(The EPERM error was always thrown on the dotfile.)

@ArtskydJ ArtskydJ closed this Mar 23, 2015
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

Successfully merging this pull request may close these issues.

Error: EPERM, rename '...something...'
1 participant