X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 15 Feb 2012 10:33:52 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: File operations really slow in emacs Message-ID: <20120215093352.GN25918@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4F35C1E0 DOT 2020308 AT cs DOT utoronto DOT ca> <20120211101158 DOT GC9823 AT calimero DOT vinschen DOT de> <4F3910B2 DOT 3070905 AT cs DOT utoronto DOT ca> <4F3A63AF DOT 7010905 AT cs DOT utoronto DOT ca> <20120214135246 DOT GA25918 AT calimero DOT vinschen DOT de> <4F3A7357 DOT 4010505 AT cs DOT utoronto DOT ca> <20120214151745 DOT GD25918 AT calimero DOT vinschen DOT de> <20120214171815 DOT GF25918 AT calimero DOT vinschen DOT de> <20120214172657 DOT GG25918 AT calimero DOT vinschen DOT de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Feb 15 04:35, Mark Geisert wrote: > Corinna Vinschen writes: > > > > Does anybody know a system call which allows to fetch the network drive > > > > state (connected/not connected) without a billion microsecond timeout? > > > > > > I just looked into this and I really don't see a way. While there's a > > > NetUseGetInfo call, which is pretty fast even for unavailable drives, > > > it's not reliable. Even if the drive is available again, it can take > > > minutes in which it still returns a status of "Session lost". I'm not > > > sure this is what we want. > > > > ...and the call doesn't work for NFS drives. Too bad. > > Does WNetGetConnection() do any better? It's referenced on the NetUseGetInfo() > page in MSDN. Claims to support other providers besides SMB. Yes, that's right. Alas, BTDT. The function returns success even if the share becomes unavailable. > Apart from that, is "net use" the mount table Ryan was referring to? Can we > tell what it's doing to identify connected and disconnected drives? Given it's import table it uses all functions available. I see at least these: NetUseEnum NetUseGetInfo WNetCloseEnum WNetEnumResourceW WNetOpenEnumW WNetGetConnectionW WNetGetLastErrorW WNetCancelConnection2W WNetAddConnection2W But "net use" is not quite accurate either. If you switch off a remote share it recognizes the disconmnection pretty fast, but if the share becomes available again, it stays in the disconnected state for quite some time, just like the NetUseGetInfo function. But, on second thought, maybe that's ok for us. It would at least help for SMB drives. I'll look into that again at one point. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple