FileReference: Loading a Windows-locked file?

A possible (dirty) workaround might be to wait for -let say- 10 seconds, and suppose that the file isn't available if no event has triggered then.

A possible (dirty) workaround might be to wait for -let say- 10 seconds, and suppose that the file isn't available if no event has triggered then. Using a setTimeout (and clearing it with clearTimeout in your COMPLETE and *_ERROR events handlers) might do the trick. I'll be glad if someone could come up with a nicer solution, though.

EDIT: Of course you might want to listen to HTTP_STATUS event (waiting for a 202 answer - if I understood this documentation correctly) rather than waiting for COMPLETE or *_ERROR.

Would've been easier if you could access the win32 api, using CreateFile API to open the file for read access and check wether it returns an valid handler or not. But without that... your workaround sounds the only way to go. – user97863 Mar 17 '10 at 6:55 This is the way I ended up handling it--extending FileReference with an internal Timer instance that is started on load, stopped on "completion" (complete or error), and reset on progress.

If the timer runs out, the load is cancelled and a timeout event is dispatched. – Michael Brewer-Davis Mar 22 '10 at 17:31 (I didn't use the HTTP_STATUS event because I'm only interested in files from the local machine; no HTTP events appear to be fired in that case. ) – Michael Brewer-Davis Mar 22 '10 at 17:33.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions