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

Remove rename (causing EPERM error on Windows) #103

Closed
wants to merge 1 commit into from
Closed

Remove rename (causing EPERM error on Windows) #103

wants to merge 1 commit into from

Conversation

manuelcabral
Copy link

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

@manuelcabral
Copy link
Author

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

@ArtskydJ
Copy link

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

@ghost
Copy link

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