tomlokhorst / CoffeeSharp

CoffeeScript compilation for Windows
http://tomlokhorst.github.io/CoffeeSharp
Other
57 stars 8 forks source link

watch locking test.coffee? #4

Closed dietrich closed 13 years ago

dietrich commented 13 years ago

C:\coffee>coffee.exe -o .\bin -c .\src --watch

1) Watch initially runs correctly. 2) make a a change to .\src\test.coffee and save: output shows that it compiled 2twice. eg 1:30:04 PM - compiled test.coffee 1:30:13 PM - compiled test.coffee 3) save test.coffee again and I get the following error:

Unhandled Exception: System.IO.IOException: The process cannot access the file ' C:\coffee\src\test.coffee' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, I nt32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions o ptions, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolea n useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detec tEncodingFromByteOrderMarks, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at Program.compileScript(String dir, String fn, Boolean bare, Boolean print, FSharpOption`1 outputDir, Boolean log) at Program.onChange@81.Invoke(FileSystemEventArgs e) at Microsoft.FSharp.Control.CommonExtensions.SubscribeToObservable@1766.OnNex t(T value) at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.h@720.Invoke(Object _arg1, TArgs args) at Program.watch@86-3.Invoke(Object sender, FileSystemEventArgs e) at System.IO.FileSystemWatcher.OnChanged(FileSystemEventArgs e) at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name) at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt 32 numBytes, NativeOverlapped* overlappedPointer) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

dietrich commented 13 years ago

btb besides that: thanks great app.

tomlokhorst commented 13 years ago

I've not seen this happening myself. My guess is that your editor has the file locked, which is why coffee.exe can't access it, but that's just a guess.

What editor are you using?

I'll try and see if I can reproduce this by using different editors.

dietrich commented 13 years ago

Thanks. For me the issue is resolved: after reading your response, I switched from a XP machine (which gets the error -- I suspect it's a problem particular to this machine's remote administration) to a Windows 7 box. The Windows 7 box works fine.... But if someone else gets the error, I doubt it's a editor locking issue... I use gVim on both machines and tried several editor on the xp machine... thank again. --Dietrich