2666 |
;;;; Directory information caching support. |
;;;; Directory information caching support. |
2667 |
;;;; ------------------------------------------------------------ |
;;;; ------------------------------------------------------------ |
2668 |
|
|
|
(defconst ange-ftp-date-regexp |
|
|
(let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)") |
|
|
;; In some locales, month abbreviations are as short as 2 letters, |
|
|
;; and they can be padded on the right with spaces. |
|
|
;; weiand: changed: month ends with . or , or ., |
|
|
;;old (month (concat l l "+ *")) |
|
|
(month (concat l l "+[.]?,? *")) |
|
|
;; Recognize any non-ASCII character. |
|
|
;; The purpose is to match a Kanji character. |
|
|
(k "[^\0-\177]") |
|
|
(s " ") |
|
|
(mm "[ 0-1][0-9]") |
|
|
;; weiand: changed: day ends with . |
|
|
;;old (dd "[ 0-3][0-9]") |
|
|
(dd "[ 0-3][0-9][.]?") |
|
|
(western (concat "\\(" month s dd "\\|" dd s month "\\)")) |
|
|
(japanese (concat mm k s dd k))) |
|
|
;; Require the previous column to end in a digit. |
|
|
;; This avoids recognizing `1 may 1997' as a date in the line: |
|
|
;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README |
|
|
;; albinus: |
|
|
;; Require also the following column to start in a digit. |
|
|
;; This avoids recognizing `kfs 10' as a date in the line: |
|
|
;; -rw------- 1 kfs 10 May 27 2003 .autorun.lck |
|
|
;; (concat "[0-9]" s "\\(" western "\\|" japanese "\\)" s)) |
|
|
(concat "[0-9]" s "\\(" western "\\|" japanese "\\)" s "+[0-9]")) |
|
|
"Regular expression to match up to the column before the file name in a |
|
|
directory listing. This regular expression is designed to recognize dates |
|
|
regardless of the language.") |
|
|
|
|
2669 |
(defvar ange-ftp-add-file-entry-alist nil |
(defvar ange-ftp-add-file-entry-alist nil |
2670 |
"Alist saying how to add file entries on certain OS types. |
"Alist saying how to add file entries on certain OS types. |
2671 |
Association list of pairs \( TYPE \. FUNC \), where FUNC |
Association list of pairs \( TYPE \. FUNC \), where FUNC |
2700 |
;;Extract the filename from the current line of a dired-like listing. |
;;Extract the filename from the current line of a dired-like listing. |
2701 |
`(let ((eol (progn (end-of-line) (point)))) |
`(let ((eol (progn (end-of-line) (point)))) |
2702 |
(beginning-of-line) |
(beginning-of-line) |
2703 |
(if (re-search-forward ange-ftp-date-regexp eol t) |
(if (re-search-forward directory-listing-before-filename-regexp eol t) |
2704 |
(progn |
(buffer-substring (point) eol)))) |
|
(skip-chars-forward " ") |
|
|
(skip-chars-forward "^ " eol) |
|
|
(skip-chars-forward " " eol) |
|
|
;; We bomb on filenames starting with a space. |
|
|
(buffer-substring (point) eol))))) |
|
2705 |
|
|
2706 |
;; This deals with the F switch. Should also do something about |
;; This deals with the F switch. Should also do something about |
2707 |
;; unquoting names obtained with the SysV b switch and the GNU Q |
;; unquoting names obtained with the SysV b switch and the GNU Q |
2816 |
;; (3) The twilight zone. |
;; (3) The twilight zone. |
2817 |
;; We'll assume (1) for now. |
;; We'll assume (1) for now. |
2818 |
nil) |
nil) |
2819 |
((re-search-forward ange-ftp-date-regexp nil t) |
((re-search-forward directory-listing-before-filename-regexp nil t) |
2820 |
(beginning-of-line) |
(beginning-of-line) |
2821 |
(ange-ftp-ls-parser switches)) |
(ange-ftp-ls-parser switches)) |
2822 |
((re-search-forward "^[^ \n\t]+ +\\([0-9]+\\|-\\|=\\) " nil t) |
((re-search-forward "^[^ \n\t]+ +\\([0-9]+\\|-\\|=\\) " nil t) |
5497 |
(let ((tbl (make-hash-table :test 'equal))) |
(let ((tbl (make-hash-table :test 'equal))) |
5498 |
(goto-char (point-min)) |
(goto-char (point-min)) |
5499 |
(save-match-data |
(save-match-data |
5500 |
(while (re-search-forward ange-ftp-date-regexp nil t) |
(while (re-search-forward directory-listing-before-filename-regexp nil t) |
5501 |
(end-of-line) |
(end-of-line) |
5502 |
(skip-chars-backward " ") |
(skip-chars-backward " ") |
5503 |
(let ((end (point))) |
(let ((end (point))) |