Skip to content

Fix permissions error (EPERM) on Windows#159

Closed
ArtskydJ wants to merge 2 commits intobrowserify:masterfrom
ArtskydJ:fix-eperm2
Closed

Fix permissions error (EPERM) on Windows#159
ArtskydJ wants to merge 2 commits intobrowserify:masterfrom
ArtskydJ:fix-eperm2

Conversation

@ArtskydJ
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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