* ange-ftp does not wait for file download to complete
@ 2006-03-11 23:34 Lennart Borgman
2006-03-12 21:11 ` Lennart Borgman
0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2006-03-11 23:34 UTC (permalink / raw)
When retrieving a file through ftp with something like
C-x C-f Find file:
/ftp:user@ftphost.somewhere.net:/some-path/the-file.html
most of the times for me the file buffer will be empty.
I do not understand what is happening. I added some (message ...)
statements for tracing. Here is what I got in the message buffer:
*** ange-ftp-raw-send-cmd *ftp someuser@some.host.com* get
/htdocs/testing/EmacsW32Util.html
d:/DOCUME~1/THEUSER~1/LOCALS~1/Temp/ange-ftp18963gD
Retrieving
/ftp:someuser@some.host.com:/htdocs/testing/EmacsW32Util.html...26k
>>>> handle-line=
>>>> handle-line=226-File successfully transferred
>>>> handle-line=226 0.000 seconds (measured here), 281.23 Mbytes
per second
>>>> good-msgs=226 0.000 seconds (measured here), 281.23 Mbytes
per second
Retrieving
/ftp:someuser@some.host.com:/htdocs/testing/EmacsW32Util.html...done
file-exists-p d:/DOCUME~1/THEUSER~1/LOCALS~1/Temp/ange-ftp18963gD
file-readable-p d:/DOCUME~1/THEUSER~1/LOCALS~1/Temp/ange-ftp18963gD
--- attr -1 0 =(nil 1 0 0 (17427 23662) (17427 23662) (17427 23660)
0 -rw-rw-rw- nil -23880 (7235 . 55565))
--- attr 0 0 =(nil 1 0 0 (17427 23662) (17427 23662) (17427 23660)
0 -rw-rw-rw- nil -23880 (7235 . 55565)) [2 times]
--- attr 0 0 =(nil 1 0 0 (17427 23663) (17427 23663) (17427 23660)
4344 -rw-rw-rw- nil -23880 (7235 . 55565))
--- attr 0 4344 =(nil 1 0 0 (17427 23663) (17427 23663) (17427
23660) 4344 -rw-rw-rw- nil -23880 (7235 . 55565))
See below for an diff showing where the messages comes from. As can be
seen from the output the file does not seem to be transfered when status
226 is recieved. (sit-for 15) does not work either here. The file is
actually 28k, but only 4k are recieved above (the transfer is still in
progress and actually finishes fine).
I have been testing this with the ftp program that comes with w2k, the
one mentioned at http://www.emacswiki.org/cgi-bin/wiki/AngeFtp and also
ncftp from Cygwin. I am doing this on windows 2000:
GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-03-08 on W2ONE
-------------------------------------------------------------------------------------------
*** ange-ftp.el 2006-02-12 13:41:30.808964800 +0100
--- \emacs\u\060308\emacs\lisp\net\ange-ftp.el 2006-03-12
00:19:46.953198000 +0100
***************
*** 1554,1559 ****
--- 1554,1560 ----
"Look at the given LINE from the ftp process PROC.
Try to categorize it into one of four categories:
good, skip, fatal, or unknown."
+ (message ">>>> handle-line=%s" line)
(cond ((string-match ange-ftp-xfer-size-msgs line)
(setq ange-ftp-xfer-size
(/ (string-to-number (match-string 1 line))
***************
*** 1561,1566 ****
--- 1562,1568 ----
((string-match ange-ftp-skip-msgs line)
t)
((string-match ange-ftp-good-msgs line)
+ (message ">>>> good-msgs=%s" line)
(setq ange-ftp-process-busy nil
ange-ftp-process-result t
ange-ftp-pending-error-line nil
***************
*** 1838,1843 ****
--- 1840,1846 ----
process that caused the command to complete.
If NOWAIT is given then the routine will return immediately the
command has
been queued with no result. CONT will still be called, however."
+ (message "*** ange-ftp-raw-send-cmd %s %s " proc cmd )
(if (memq (process-status proc) '(run open))
(with-current-buffer (process-buffer proc)
(ange-ftp-wait-not-busy proc)
***************
*** 3334,3339 ****
--- 3337,3359 ----
(sleep-for ange-ftp-retry-time)
;; Wait for file to hopefully appear.
(ange-ftp-real-file-readable-p temp))
+ (progn
+ (if (file-exists-p temp)
+ (message "file-exists-p %s" temp)
+ (message "NOT file-exists-p %s" temp))
+ (if (file-readable-p temp)
+ (message "file-readable-p %s" temp)
+ (message "NOT file-readable-p %s" temp))
+ (let ((size 0)
+ (old-size -1)
+ attr)
+ (while (/= size old-size)
+ (setq attr (file-attributes temp))
+ (message "--- attr %s %s =%s" old-size
size attr)
+ (setq old-size size)
+ (setq size (nth 7 attr))
+ (sleep-for 15)
+ ))
(setq
size
(nth 1 (ange-ftp-real-insert-file-contents
***************
*** 3342,3347 ****
--- 3362,3368 ----
;; override autodetection of buffer file type
;; to ensure buffer is saved in DOS format
buffer-file-type binary)
+ )
(signal 'ftp-error
(list
"Opening input file:"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ange-ftp does not wait for file download to complete
2006-03-11 23:34 ange-ftp does not wait for file download to complete Lennart Borgman
@ 2006-03-12 21:11 ` Lennart Borgman
2006-03-13 12:55 ` Richard Stallman
0 siblings, 1 reply; 3+ messages in thread
From: Lennart Borgman @ 2006-03-12 21:11 UTC (permalink / raw)
Lennart Borgman wrote:
> When retrieving a file through ftp with something like
>
> C-x C-f Find file:
> /ftp:user@ftphost.somewhere.net:/some-path/the-file.html
>
> most of the times for me the file buffer will be empty.
>
> I do not understand what is happening. I added some (message ...)
> statements for tracing. Here is what I got in the message buffer:
>
>
...
> I have been testing this with the ftp program that comes with w2k, the
> one mentioned at http://www.emacswiki.org/cgi-bin/wiki/AngeFtp and
> also ncftp from Cygwin. I am doing this on windows 2000:
>
> GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-03-08 on W2ONE
I must have made some mistake when testing. Today I have no problem at
all when using the ftp program suggested at EmacsWiki.
Probably I was setting the wrong variable when testing yesterday. Sorry
for the noice. However maybe the problem with Windows ftp should be
mentioned in the manual?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ange-ftp does not wait for file download to complete
2006-03-12 21:11 ` Lennart Borgman
@ 2006-03-13 12:55 ` Richard Stallman
0 siblings, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2006-03-13 12:55 UTC (permalink / raw)
Cc: emacs-devel
Probably I was setting the wrong variable when testing yesterday. Sorry
for the noice. However maybe the problem with Windows ftp should be
mentioned in the manual?
Maybe just in PROBLEMS.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-13 12:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-11 23:34 ange-ftp does not wait for file download to complete Lennart Borgman
2006-03-12 21:11 ` Lennart Borgman
2006-03-13 12:55 ` Richard Stallman
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.