diff lisp/net/tramp-smb.el @ 50338:155b4b78aa3b

* tramp.el: Version 2.0.31 released. (tramp-handle-expand-file-name): Do not allow ".." to cross file handler boundaries, so that "/user@host:/../foo" expands to itself, rather than "/foo". This is intended to work in conjunction with a change in `file-relative-name' which makes sure to use absolute file names if FILE and DIRECTORY have different handlers. (tramp-handle-insert-directory): Comment out XEmacs kludge. Suggested by Katsumi Yamaoka <yamaoka@jpl.org>. * Makefile.in (../info/tramp): Compile Emacs, instead of XEmacs, version of manual. * tramp.texi (Auto-save and Backup): New node.
author Kai Großjohann <kgrossjo@eu.uu.net>
date Sat, 29 Mar 2003 15:16:57 +0000
parents a0e8a85259ed
children 695cf19ef79e
line wrap: on
line diff
--- a/lisp/net/tramp-smb.el	Sat Mar 29 02:57:19 2003 +0000
+++ b/lisp/net/tramp-smb.el	Sat Mar 29 15:16:57 2003 +0000
@@ -754,21 +754,38 @@
 ;; They should have the format
 ;;
 ;; \s-\{2,2}                              - leading spaces
-;; \S-\(.*\S-\)\s-*                       - file name, 32 chars, left bound
+;; \S-\(.*\S-\)\s-*                       - file name, 30 chars, left bound
+;; \s-+[ADHRSV]*                          - permissions, 7 chars, right bound
 ;; \s-                                    - space delimeter
-;; \s-*[ADHRS]*                           - permissions, 5 chars, right bound
-;; \s-                                    - space delimeter
-;; \s-*[0-9]+                             - size, 8 (Samba) or 7 (Windows)
-;;                                          chars, right bound
+;; \s-+[0-9]+                             - size, 8 chars, right bound
 ;; \s-\{2,2\}                             - space delimeter
 ;; \w\{3,3\}                              - weekday
 ;; \s-                                    - space delimeter
+;; \w\{3,3\}                              - month
+;; \s-                                    - space delimeter
 ;; [ 19][0-9]                             - day
 ;; \s-                                    - space delimeter
 ;; [0-9]\{2,2\}:[0-9]\{2,2\}:[0-9]\{2,2\} - time
 ;; \s-                                    - space delimeter
 ;; [0-9]\{4,4\}                           - year
 ;;
+;; samba/src/client.c (http://samba.org/doxygen/samba/client_8c-source.html)
+;; has function display_finfo:
+;;
+;;   d_printf("  %-30s%7.7s %8.0f  %s",
+;;            finfo->name,
+;;            attrib_string(finfo->mode),
+;;            (double)finfo->size,
+;;            asctime(LocalTime(&t)));
+;;
+;; in Samba 1.9, there's the following code:
+;;
+;;   DEBUG(0,("  %-30s%7.7s%10d  %s",
+;;  	   CNV_LANG(finfo->name),
+;;	   attrib_string(finfo->mode),
+;;	   finfo->size,
+;;	   asctime(LocalTime(&t))));
+;;
 ;; Problems:
 ;; * Modern regexp constructs, like spy groups and counted repetitions, aren't
 ;;   available in older Emacsen.
@@ -828,27 +845,28 @@
 
 	;; size
 	(if (string-match "\\([0-9]+\\)$" line)
-	    (setq
-	     size (string-to-number (match-string 1 line))
-	     line (substring
-		   line 0 (- (max 8 (1+ (length (match-string 1 line)))))))
+	    (let ((length (- (max 10 (1+ (length (match-string 1 line)))))))
+	      (setq size (string-to-number (match-string 1 line)))
+	      (when (string-match "\\([ADHRSV]+\\)" (substring line length))
+		(setq length (+ length (match-end 0))))
+	      (setq line (substring line 0 length)))
 	  (return))
 
-	;; mode
-	(if (string-match "\\(\\([ADHRS]+\\)?\\s-?\\)$" line)
+	;; mode: ARCH, DIR, HIDDEN, RONLY, SYSTEM, VOLID
+	(if (string-match "\\([ADHRSV]+\\)?$" line)
 	    (setq
-	     mode (or (match-string 2 line) "")
+	     mode (or (match-string 1 line) "")
 	     mode (save-match-data (format
 		    "%s%s"
 		    (if (string-match "D" mode) "d" "-")
 		    (mapconcat
 		     (lambda (x) "") "    "
 		     (concat "r" (if (string-match "R" mode) "-" "w") "x"))))
-	     line (substring line 0 (- (1+ (length (match-string 2 line))))))
+	     line (substring line 0 -7))
 	  (return))
 
 	;; localname
-	(if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-+$" line)
+	(if (string-match "^\\s-+\\(\\S-\\(.*\\S-\\)?\\)\\s-*$" line)
 	    (setq localname (match-string 1 line))
 	  (return))))