Skip to content

Remove rename (causing EPERM error on Windows)#103

Closed
manuelcabral wants to merge 1 commit intobrowserify:masterfrom
digisfera:master
Closed

Remove rename (causing EPERM error on Windows)#103
manuelcabral wants to merge 1 commit intobrowserify:masterfrom
digisfera:master

Conversation

@manuelcabral
Copy link
Copy Markdown

Fixes #83 by writing directly to the output file rather than writing to a temp file and renaming it.

@manuelcabral
Copy link
Copy Markdown
Author

Doesn't really work. May trigger livereload ahead of time, for instance.

@ArtskydJ
Copy link
Copy Markdown

@manuelcabral How does this 'not really work'? It works for me...

@ghost
Copy link
Copy Markdown

ghost commented Mar 22, 2015

@manuelcabral that might be because if you're watching a file on windows and it gets renamed, you'll often get a spurious EPERM nodejs/node-v0.x-archive#3250 nodejs/node-v0.x-archive#4337

@manuelcabral
Copy link
Copy Markdown
Author

The problem is slightly different when using this on Windows. There is no EPERM, but if the file is being watched the watch is triggered before the full file is written. This is not desirable. If the watch is used to trigger livereload, for instance, the browser will load an incomplete file.

This however seems to work: digisfera@f3f61b4 . The difference is that it uses fs.writeFile() instead of stream.pipe(fs.createWriteStream()).

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...'

2 participants