>>>> "Andy" == Andy Piper
<andyp(a)parallax.co.uk> writes:
Andy> At 00:16 06/11/98 +0000, Jonathan Harris wrote:
> are not extensive; w3 didn't need changing at all in the
end,
> and if I recall correctly the required changes to efs amount to
> changing four lines, three of which are currently doing the
> wrong thing on UNIX systems anyway.
Andy> Do you still have the patch so that we can beat Michael over
Andy> the head with it...
Here it is once again. I really don't understand how Michael can keep
claiming the following in the face of reality:
MS> To my defense, I'll say that I tried to time an EFS release with the
MS> release of 21.0. I did put up the EFS release, but then 21.0 didn't
MS> happen. For that release, I'd repeatedly asked the NT folks what the
I don't recall Michael to ever ask on xemacs-*(a)xemacs.org.
MS> issues were with getting EFS to work on NT, and I'd not gotten a
MS> useable answer.
I do recall that Jonathan explained the changes implemented in his patch
below very well.
And I finally recall that several people have been begging Michael
numerous times now to PLEASE apply the patch, which has been proven to
work by many people using Windows NT native build.
Maybe we should try to bribe Michael?
Let's start collecting the money with my 2 cents, ploink, ploink.
Adrian
X-From-Line: owner-xemacs-nt(a)xemacs.org Mon Sep 7 17:33 MET 1998
Received: from
rapier.ecf.teradyne.com (
rapier.ecf.teradyne.com [131.101.48.1]) by
engine.ecf.teradyne.com (8.7.1/8.7.1) with ESMTP id RAA02291 for
<aichner(a)ecf.teradyne.com>; Mon, 7 Sep 1998 17:33:04 +0200 (MET DST)
Received: from
steadfast.teradyne.com (
steadfast.teradyne.com [131.101.1.200]) by
rapier.ecf.teradyne.com (8.7.1/8.7.1) with ESMTP id QAA16625 for
<aichner(a)ecf.teradyne.com>; Mon, 7 Sep 1998 16:32:25 +0100 (BST)
Received: from
gwyn.tux.org (
gwyn.tux.org [207.96.122.8]) by
steadfast.teradyne.com
(8.8.5/8.7.1) with ESMTP id LAA04100 for <aichner(a)ecf.teradyne.com>; Mon, 7 Sep 1998
11:35:52 -0400 (EDT)
Received: (from majordom@localhost)
by
gwyn.tux.org (8.8.8/8.8.8) id LAA05492
for xemacs-nt-out; Mon, 7 Sep 1998 11:10:48 -0400
Received: from
sendmail.psion.com (
sendmail.psion.com [194.129.1.253])
by
gwyn.tux.org (8.8.8/8.8.8) with ESMTP id LAA05489
for <xemacs-nt(a)xemacs.org>; Mon, 7 Sep 1998 11:10:45 -0400
Received: from tardis.ed.ac.uk (
dhcp022.plc.psion.com [194.129.2.22])
by
sendmail.psion.com (2.5 Build 2639 (Berkeley 8.8.6)/8.8.4) with ESMTP
id QAA01161; Mon, 07 Sep 1998 16:08:16 +0100
Message-ID: <35F3F751.962EF3DC(a)tardis.ed.ac.uk>
Date: Mon, 07 Sep 1998 16:10:09 +0100
From: Jonathan Harris <jhar(a)tardis.ed.ac.uk>
Organization: Very little
X-Mailer: Mozilla 4.05 [en] (WinNT; U)
To: Michael Sperber <sperber(a)informatik.uni-tuebingen.de>
CC: XEmacs NT List <xemacs-nt(a)xemacs.org>
Subject: Changes to efs to run on XEmacs on windowsnt (WinNT and Win95)
Sender: owner-xemacs-nt(a)xemacs.org
Precedence: bulk
X-Mailing-List: <xemacs-nt(a)xemacs.org>
X-Content-Length: 9565
Xref:
tomorrow.ecf.teradyne.com xemacs-nt:874
Lines: 254
This is a multi-part message in MIME format.
--------------AA845F733902A3DC3F602EBE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Michael,
The enclosed patch against XEmacs efs package 1.08, version 1.16, makes
efs work on XEmacs on windows-nt systems. For historical reasons
'windows-nt is returned as the system-type on Windows NT, 95 and 98
systems. I've only verified dired, find-file and save-buffer
functionality, so their may be other problems that I've missed.
Please let me know if there is anything here that you dislike, and I'll
to address your concerns. Should I also submit this patch to efs-bugs?
/tmp doesn't necessarily exist on WinNT and Win95 systems, so I changed
efs-tmp-name-template to use the temp-directory function where
available.
The nslookup method of finding the fully-qualified hostname doesn't work
on WinNT (I didn't investigate very far), and nslookup is shipped at all
on Win95 which causes an error. I changed efs-nslookup-program to be nil
on windows-nt systems. I also changed the customize type from 'string to
'(choice string (const nil)) because the DOC string says that nil is a
valid value for this variable, but XEmacs customize thinks that nil not
a correct value for a 'string variable.
The ftp program supplied with WinNT and Win95 buffers stdout when
displaying the "ftp>" prompt alone, but flushes stdout when outputting
all other information. The buffering of the "ftp>" prompt causes
efs-pty-check to fail. I changed efs-pty-check to output a "help foo"
command to ftp on windows-nt systems, and this causes ftp to reply. This
hack was taken from the ange-ftp sources in emacs-20.3.1. I also
changed efs-pty-check to skip the second check on windows-nt systems.
I removed the (efs-quote-string host-type cmd) call on the local
filename in the GET, PUT and APPEND commands in efs-send-cmd. The local
filename is not sent to the remote host, so quoting according to
host-type is wrong and breaks filenames like C:\TEMP\efsxxxx under
windows-nt. I don't think that any quoting is necessary on these
filenames, but if it is necessary it should be according to the local
system-type and not according to the remote host-type.
I changed efs-internal-file-name-as-directory to manually add a '/'
instead of calling file-name-as-directory because file-name-as-directory
adds a '\' on XEmacs windows-nt systems. A previous patch had similar
changes to efs-file-name-directory and efs-internal-directory-file-name,
but I altered the XEmacs file handling functions to make these changes
unnecessary.
1998-09-92 Jonathan Harris <jhar(a)tardis.ed.ac.uk>
* efs.el:
(efs-tmp-name-template): use temp-directory if fbound.
(efs-nslookup-program): set to nil on windows-nt systems.
(efs-pty-check): On windows-nt systems, prod the ftp program
with a "help foo" command, and skip the second check.
(efs-send-cmd): Don't quote the second filename in GET
commands or the first filename in PUT or APPEND commands
because these filenames refer to local files.
(efs-umask): umask and /bin/sh don't exist on windows-nt
systems, so don't try to call-process "/bin/sh -c umask".
(efs-internal-file-name-as-directory): Manually add a '/'
instead of calling file-name-as-directory.
Jonathan.
--
Jonathan Harris | jhar(a)tardis.ed.ac.uk
London, England | Jonathan.Harris(a)symbian.com
--------------AA845F733902A3DC3F602EBE
Content-Type: text/plain; charset=us-ascii; name="efs-w32.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="efs-w32.patch"
--- efs.el.orig Sat Mar 14 09:18:22 1998
+++ efs.el Mon Sep 07 01:50:00 1998
@@ -576,7 +576,8 @@
;;; End of gateway config variables.
-(defcustom efs-tmp-name-template "/tmp/efs"
+(defcustom efs-tmp-name-template
+ (concat (if (fboundp 'temp-directory) (temp-directory) "/tmp")
"/efs")
"Template used to create temporary files.
If you are worried about security, make this a directory in some
bomb-proof cave somewhere. efs does clean up its temp files, but
@@ -769,9 +770,11 @@
:type 'regexp
:group 'efs-programs)
-(defcustom efs-nslookup-program "nslookup"
+(defcustom efs-nslookup-program
+ (unless (eq system-type 'windows-nt) "nslookup")
"*If non-NIL then a string naming nslookup program."
- :type 'string
+ :type '(choice string
+ (const nil))
:group 'efs-programs)
(defcustom efs-nslookup-on-connect nil
@@ -2977,6 +2980,11 @@
(n 0))
(set-process-filter proc (function (lambda (proc string)
(setq efs-pipe-p nil))))
+ (when (eq system-type 'windows-nt)
+ ;; The Windows standard ftp client appears to flush stdout when
+ ;; responding to a command, but the startup message and the response
+ ;; to a sole '\n' are buffered, so we have to give it a prod.
+ (process-send-string proc "help foo\n"))
(while (and (< n threshold) efs-pipe-p)
(accept-process-output)
(setq n (1+ n)))
@@ -2987,44 +2995,45 @@
;; on pending input.
(sleep-for efs-pty-check-retry-time)))
(accept-process-output)
- (if efs-pipe-p
- (if (or noninteractive
- (progn
- ;; in case the user typed something during the wait.
- (discard-input)
- (y-or-n-p
- (format "%s seems not a pty. Kill? " proc))))
- (progn
- (kill-buffer (process-buffer proc))
- (if (eq (selected-window) (minibuffer-window))
- (abort-recursive-edit)
- (signal 'quit nil))))
- ;; Need to send a \n to make sure, because sometimes we get the startup
- ;; prompt from a pipe.
- (sit-for 0)
- (process-send-string proc "\n")
- (setq efs-pipe-p t
- n 0)
- (while (and (< n threshold) efs-pipe-p)
- (accept-process-output)
- (setq n (1+ n)))
- (if efs-pipe-p
- (progn
- (sit-for 0)
- (sleep-for efs-pty-check-retry-time)))
- (accept-process-output)
- (if (and efs-pipe-p
- (or noninteractive
+ (cond (efs-pipe-p
+ (if (or noninteractive
(progn
;; in case the user typed something during the wait.
(discard-input)
(y-or-n-p
+ (format "%s seems not a pty. Kill? " proc))))
+ (progn
+ (kill-buffer (process-buffer proc))
+ (if (eq (selected-window) (minibuffer-window))
+ (abort-recursive-edit)
+ (signal 'quit nil)))))
+ ((not (eq system-type 'windows-nt))
+ ;; Need to send a \n to make sure, because sometimes we get
+ ;; the startup prompt from a pipe.
+ (sit-for 0)
+ (process-send-string proc "\n")
+ (setq efs-pipe-p t
+ n 0)
+ (while (and (< n threshold) efs-pipe-p)
+ (accept-process-output)
+ (setq n (1+ n)))
+ (if efs-pipe-p
+ (progn
+ (sit-for 0)
+ (sleep-for efs-pty-check-retry-time)))
+ (accept-process-output)
+ (if (and efs-pipe-p
+ (or noninteractive
+ (progn
+ ;; in case the user typed something during the wait.
+ (discard-input)
+ (y-or-n-p
(format "%s seems not a pty. Kill? " proc)))))
- (progn
- (kill-buffer (process-buffer proc))
- (if (eq (selected-window) (minibuffer-window))
- (abort-recursive-edit)
- (signal 'quit nil)))))))
+ (progn
+ (kill-buffer (process-buffer proc))
+ (if (eq (selected-window) (minibuffer-window))
+ (abort-recursive-edit)
+ (signal 'quit nil))))))))
(defun efs-start-process (host user name)
"Spawn a new ftp process ready to connect to machine HOST as USER.
@@ -3528,7 +3537,7 @@
(efs-set-hash-mark-unit host user t)
(setq cmd1 (efs-quote-string host-type
(efs-fix-path host-type cmd1))
- cmd2 (efs-quote-string host-type cmd2)
+ ;; cmd2 is a local file, not nec. to quote.
cmd-string (concat "get " cmd1 " " cmd2))))
;; PUT command
@@ -3540,7 +3549,7 @@
(efs-set-hash-mark-unit host user)
(setq cmd2 (efs-quote-string host-type
(efs-fix-path host-type cmd2))
- cmd1 (efs-quote-string host-type cmd1)
+ ;; cmd1 is a local file, not nec. to quote.
cmd-string (concat "put " cmd1 " " cmd2))))
;; APPEND command
@@ -3550,7 +3559,7 @@
(efs-set-hash-mark-unit host user)
(setq cmd2 (efs-quote-string host-type
(efs-fix-path host-type cmd2))
- cmd1 (efs-quote-string host-type cmd1)
+ ;; cmd1 is a local file, not nec. to quote.
cmd-string (concat "append " cmd1 " " cmd2))))
;; CHMOD command
@@ -4097,7 +4106,8 @@
(and (efs-anonymous-p user)
efs-anonymous-umask)
efs-umask
- (let* ((shell (or (and (boundp 'explicit-shell-file-name)
+ (if (not (eq system-type 'windows-nt))
+ (let* ((shell (or (and (boundp 'explicit-shell-file-name)
explicit-shell-file-name)
(getenv "ESHELL")
(getenv "SHELL")
@@ -4113,7 +4123,7 @@
(if (re-search-forward "[0-7]?[0-7]?[0-7]" nil t)
(string-to-int (buffer-substring (match-beginning 0)
(match-end 0)))))
- (kill-buffer buff)))))
+ (kill-buffer buff))))))
(defun efs-send-umask (host user mask)
"Sets the umask on HOST for USER to MASK.
@@ -6701,8 +6711,9 @@
;; By default, simply adds a trailing /, if there isn't one.
;; Note that for expanded filenames, it pays to call this rather
;; than efs-file-name-as-directory.
- (let (file-name-handler-alist)
- (file-name-as-directory name)))
+ (if (string-equal (substring name -1) "/")
+ name
+ (concat name "/")))
(defun efs-file-name-directory (name)
;; file-name-directory for remote files. Takes care not to
--------------AA845F733902A3DC3F602EBE--
Andy> andy
Andy> ---------------------------------------------------------------------------
Andy> " .sigs are like your face - rarely seen by you and uglier
Andy> than you think" Dr Andy Piper, Technical Architect, Parallax
Andy> Solutions Ltd mail: andyp(a)parallax.co.uk web:
Andy>
www.parallax.co.uk/~andyp