[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Ange-ftp and re-search-forward -- unbelievable behavior
From: |
Richard.G.Bielawski |
Subject: |
Ange-ftp and re-search-forward -- unbelievable behavior |
Date: |
Thu, 1 Sep 2005 19:57:58 -0500 |
I'm totally lost on how to investigate this further. ange-ftp stopped
working after the 8/11 update in CVS. If I use CVS as of 8/31 but the
ange-ftp version prior to 8/11 I have no problem.
At first I suspected your 8/11 changes simply required me to update the
Guardian host extensions I added to ange-ftp which are automatically
merged when I update from CVS each week. I've examined the 8/11 changes
to ange-ftp and they don't look like they should break anything. But
the
error below doesn't look like it could be caused by something my code
does wrong either and I've made no changes to my Guardian extensions in
almost a year.
The trace shows the same thing my stepping thru the code manually does.
ange-ftp-del-tmp-name is getting called from within re-search-forward.
I
totally don't understand how this could possibly happen. I've included
my function's code below in case it helps. I set debug-on-entry and
stepped into my code and sure enough I see (ange-ftp-del-tmp-name temp)
being called while within re-search-forward.
Debugger entered--Lisp error: (file-error "Removing old name"
"permission denied"
"c:/DOCUME~1/RICHAR~1.BIE/LOCALS~1/Temp/ange-ftp20522Eg")
ange-ftp-del-tmp-name("c:/DOCUME~1/RICHAR~1.BIE/LOCALS~1/Temp/ange-ftp20
522Eg")
re-search-forward("File +Code +EOF ")
ange-ftp-parse-guardian-listing()
ange-ftp-ls("/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/" "-al" t
no-error)
ange-ftp-get-files("/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/"
no-error)
ange-ftp-file-entry-p("/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
ange-ftp-file-exists-p("/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
apply(ange-ftp-file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
ange-ftp-hook-function(file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
apply(ange-ftp-hook-function file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
tramp-ftp-file-name-handler(file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
apply(tramp-ftp-file-name-handler file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
tramp-file-name-handler(file-exists-p
"/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
file-exists-p("/ftp:address@hidden:/SYSTEM.$DISK.SUBVOL/")
bookmark-file-or-variation-thereof("/ftp:address@hidden:/SYSTEM.$DIS
K.SUBVOL/")
bookmark-jump-noselect("$DISK.SUBVOL")
bookmark-jump("$DISK.SUBVOL")
bookmark-bmenu-this-window()
call-interactively(bookmark-bmenu-this-window)
(defun ange-ftp-parse-guardian-listing ()
;; Parses a Guardian ftp dir listing into a (sort of) unix style one.
;; DenyAccess 1 141, 35 "nnnu" 100 2824664 Aug 23 16:05
OBJFILE
;; -rw-rw-rw- 1 141, 35 "nunu" 101 16384 Aug 23 16:04
SRCFILE
;; The access string is arbitrary. Only 101 files are accessible.
;; Binary types are not added to the hash table and so appear missing.
;; A hash table of the 101 files in the directory is returned.
(let ((tbl (make-hash-table :test 'equal))
access)
(goto-char (point-min))
(save-match-data
;; toss old column headings
(re-search-forward "File +Code +EOF ")
(delete-region (point-min)
(progn (forward-line 1)(point)))
(while (re-search-forward ange-ftp-guardian-listing-regexp nil t)
(if (string= "101" (match-string 2))
(progn (puthash (match-string 1) nil tbl)
(setq access "-rw-rw-rw-"))
(setq access "DenyAccess"))
(let ((replacement (ange-ftp-guardian-dir-to-unix
;; attr cnt
access "1"
;; owner code
(match-string 8) (match-string 2)
;; eof mmm
(match-string 3) (match-string 5)
;; dd yy
(match-string 4) (match-string 6)
;; time fname
(match-string 7) (match-string 1))))
(replace-match replacement 'fixedcase 'literal nil 0))))
;; Don't include .. because there is no such concept here.
;; Must include . or dired will try all kinds of bizarre stuff
(puthash "." t tbl)
tbl))
(add-to-list 'ange-ftp-parse-list-func-alist
'(guardian . ange-ftp-parse-guardian-listing))
(defun ange-ftp-guardian-lj (width str)
;; Returns a string of `width' characters with `str' left justified
;; within it. If `str' is too long it is truncated on the right.
(substring (concat str (make-string width ? )) 0 width))
(defun ange-ftp-guardian-rj (width str)
;; Returns a string of `width' characters with `str' right justified
;; within it. If `str' is too long it is truncated on the left.
(substring (concat (make-string width ? ) str) (- width)))
(defun ange-ftp-guardian-dir-to-unix
(attr cnt owner code eof mmm dd yy time fname)
;; Returns fixed format
;; drwxrwxrwx nnn 255,255 "rwep" nnnnn eof-bytecount mmm dd hh:mm
FILENAME
;; where drwx... is contrived, nnnnn is the file code
(concat (ange-ftp-guardian-lj 10 attr)
(ange-ftp-guardian-rj 4 cnt)
" "
(ange-ftp-guardian-lj 14 owner)
(ange-ftp-guardian-rj 6 code)
(ange-ftp-guardian-rj 14 eof)
(ange-ftp-guardian-rj 4 mmm)
(ange-ftp-guardian-rj 3 dd)
(ange-ftp-guardian-rj 6
(cond ((string= yy (format-time-string "%y")) time)
((string< yy "75") (concat "20" yy))
(t (concat "19" yy))))
" " fname))
This is a small sample of what a dir command from Guardian looks like.
In case you need known valid test data to run the above against.
Since I never get past the first search it doesn't seem useful but
I'm lost so there's no telling what you might find useful.
File Code EOF Last Modification Owner RWEP
ALLCOMP 101 1141010 9-Aug-05 22:29:29 141, 35 "nnnu"
ALLCOMP2 101 20116 9-Aug-05 23:13:54 141, 35 "nnnu"
APPL 101 147306 6-Jul-05 11:38:41 141, 35 "nnnu"
AUDFILTC 101 382 24-Aug-05 08:38:13 141, 35 "nnnu"
AUDFILTO 100 722806 24-Aug-05 09:16:56 141, 35 "nnnu"
B2460 101 81764 6-Jul-05 11:38:46 141, 35 "nnnu"
B24DIFF 101 3590 8-Aug-05 15:51:05 141, 35 "nnnu"
Richard Bielawski
612-667-5039
- Ange-ftp and re-search-forward -- unbelievable behavior,
Richard.G.Bielawski <=
- RE: Ange-ftp and re-search-forward -- unbelievable behavior, Richard.G.Bielawski, 2005/09/05
- Re: Ange-ftp and re-search-forward -- unbelievable behavior, Richard.G.Bielawski, 2005/09/05
- Re: Ange-ftp and re-search-forward -- unbelievable behavior, Stefan Monnier, 2005/09/06
- Running elisp code in the middle of re-search-forward, Stefan Monnier, 2005/09/06
- Re: Running elisp code in the middle of re-search-forward, Richard M. Stallman, 2005/09/07
- Re: Running elisp code in the middle of re-search-forward, Stefan Monnier, 2005/09/07
- Re: Running elisp code in the middle of re-search-forward, Richard M. Stallman, 2005/09/08
- Re: Running elisp code in the middle of re-search-forward, Stefan Monnier, 2005/09/08
- Re: Running elisp code in the middle of re-search-forward, Richard M. Stallman, 2005/09/09