You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am just using gulp src and dest to copy files to a location where it will be hosted. Currently nothing has a handle on this dest directory. First time I run the task it completes successfully (folder didn't exist before gulp.dest was called). I run it again and now I see:
"C:\Program Files (x86)\JetBrains\WebStorm 10.0.2\bin\runnerw.exe""C:\Program Files (x86)\nodejs\node.exe" C:\Users\user\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js--color--gulpfilec:\Workspaces\xxx\Main\UI\WebUI\gulpfile.jscopy-templates[13:02:41]Usinggulpfilec:\Workspaces\xxx\Main\UI\WebUI\gulpfile.js[13:02:41]Starting'copy-templates'...[13:02:42] 'copy-templates' errored after 32 ms[13:02:42] Error: EPERM, open 'C:\website\build\templates\dashboard.html'
at Error (native)
Process finished with exit code 1
This is running on a windows 7 64bit os, here is the gulp code I am running:
This is not a problem with gulp, so I apologize for posting it here but I will present a solution to those that found themselves here. Its because the source file has the read-only attribute on it (could be TFS or some other source control or other software putting that on the file). So when fs streams it the source to the destination it contains the same attributes.
Simple solution is to stream the source files into gulp-foreach and modify the file.stat.mode. I found I could do this by using bit flag math. I found that when the read-only attribute is applied the mode was missing 128,16, and 2 bits (146). If you turn those bits on the read-only is removed (seems backwards but it works).
I am just using gulp src and dest to copy files to a location where it will be hosted. Currently nothing has a handle on this dest directory. First time I run the task it completes successfully (folder didn't exist before gulp.dest was called). I run it again and now I see:
This is running on a windows 7 64bit os, here is the gulp code I am running:
If I remove the read-only attribute that is applied to the C:\website\build directory I can successfully run the task over top the existing files.
The text was updated successfully, but these errors were encountered: