Subject: bug#3542 closed by Eli Zaretskii <[email-masked]> (Re: bug #3542 (23.0.94; File access via UNC path slow again under Windows))

From: [email-masked] (Emacs bug Tracking System)
Date: Thu, 09 Jul 2009 19:00:06 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs,w32 package:

#3542: 23.0.94; File access via UNC path slow again under Windows

It has been closed by Eli Zaretskii <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Eli Zaretskii <[email-masked]> by
replying to this email.

-- 
3542: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3542
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug #3542 (23.0.94; File access via UNC path slow again under Windows)
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Date: Thu, 09 Jul 2009 21:50:19 +0300

> From: Mathias Dahl <[email-masked]>
> Date: Sun, 5 Jul 2009 23:01:53 +0200
> 
> I understand that the release of 23.1 is not far away and I am a bit
> worried that this bug won't be solved before that. Is there anything I
> can do to help? I use a lot of UNC file names / paths in my work and
> the current slowness is very annoying (both opening files and listing
> them in Dired). As this was a problem in the past too it isn't
> unreasonable to believe that the bug has reappeared by mistake when
> fixing some other thing (could it be related to TRAMP?).
> 
> I am willing to go bug hunting as long as it's in elisp-land and would
> like to get some hints on where to start digging.
> 
> For details see:
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3542
> 
> Thanks!

Fixed with this patch:

2009-07-09  Eli Zaretskii  <[email-masked]>

	* w32.c (stat): Treat UNC file names as residing on remote
	drives.  (Bug#3542)

--- src/w32.c.orig	2009-06-21 10:38:18.000000000 +0300
+++ src/w32.c	2009-07-09 16:31:51.250000000 +0300
@@ -3154,11 +3154,13 @@
 	}
     }
 
-  /* GetDriveType needs the root directory of NAME's drive.  */
-  if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1])))
-    devtype = GetDriveType (NULL); /* use root of current diectory */
+  if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1]))
+    devtype = DRIVE_REMOTE;	   /* assume UNC name is remote */
+  else if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1])))
+    devtype = GetDriveType (NULL); /* use root of current drive */
   else
     {
+      /* GetDriveType needs the root directory of NAME's drive.  */
       strncpy (drive_root, name, 3);
       drive_root[3] = '\0';
       devtype = GetDriveType (drive_root);

Subject: 23.0.94; File access via UNC path slow again under Windows
From: Mathias Dahl <[email-masked]>
To: [email-masked]
Date: Fri, 12 Jun 2009 11:38:59 +0200

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the [email-masked] mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

1. Start emacs with -Q
2. Open a directory or file by entering its UNC path (e.g. C-x C-f
//server/share/folder/file.txt RET).
3. Notice it is very slow to get it to open.

I reported this before Emacs 21 or 22 was released, and it was fixed
then. In the latest two pretests the problem is now back. Working with
UNC paths is now almost unusable - I have to wait several seconds to
open a file or get a file listing in Dired.

Thanks!

/Mathias

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
e:/dat/dl/emacs-23.0.94/etc/DEBUG for instructions.

In GNU Emacs 23.0.94.1 (i386-mingw-nt5.1.2600)
 of 2009-05-24 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: SVE
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t

Major mode: Dired by name

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f / / g b g f s 1 / a r <tab> 7 5 <tab> d o c
m a n <return> <return> <return> <down> <down> <down>
<return> <help-echo> M-x v e r s <tab> <return> <help-echo>
<help-echo> <help-echo> <help-echo> <menu-bar> <help-menu>
<send-emacs-bug-report>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
GNU Emacs 23.0.94.1 (i386-mingw-nt5.1.2600) of 2009-05-24 on SOFT-MJASON