tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem getting files under SunOS (from cygwin)


From: peng wu
Subject: problem getting files under SunOS (from cygwin)
Date: Mon, 11 Feb 2013 03:14:02 -0500

From emacs under cygwin, remote OS being SunOS, problem opening files, several issues:

1. need time out longer than 60 seconds.  this slowness may be related to cygwin or the particular network situation.  Also wish tramp can ask the password immediately instead of waiting until the remote system responded with a request, because I often end up coming back to provide the password too late and have to do it again.  another wish is an option not to lock up the emacs completely while waiting the remote system to respond.

2. Before getting to the Terminal Type prompt, we have a "RETURN to continue" prompt that requires the user to hit the enter key.
In addition to adding a customer hook to detect the prompt and send the enter key, the tramp-send-string prove to be tricky because it would send nothing if "/n" is the string to be sent.  My work around is to send a space which is turned in to a space and a return key by tramp-send-string, and luckily the extra space does not hurt in this case.  tramp-send-stirng probably should send the "/n" if that is the thing to be sent.  A wish related to this is to have "just respond with a enter" prompts and action pre-defined, and the user only need to customize the prompt regexps.  Another wish might be presenting the user where things are stopped and send the user reresponse to the remote system.

3. keeps getting error saying no response from "test -e /", and my work around is to override a defun from tramp-sh:
 
;; overriding the following from tramp-sh, tramp 2.2.3-24.1:
;; add catching error thrown by tramp-send-command-and-check:
;; wrapping the calls in condition case.  Could be fixed by adding
;; an option to tramp-send-command-and-check as to what to return on error.
(defun tramp-find-file-exists-command (vec)
  "Find a command on the remote host for checking if a file exists.
Here, we are looking for a command which has zero exit status if the
file exists and nonzero exit status otherwise."
  (let ((existing "/")
        (nonexistent
  (tramp-shell-quote-argument "/ this file does not exist "))
 result)
    ;; The algorithm is as follows: we try a list of several commands.
    ;; For each command, we first run `$cmd /' -- this should return
    ;; true, as the root directory always exists.  And then we run
    ;; `$cmd /this\ file\ does\ not\ exist ', hoping that the file indeed
    ;; does not exist.  This should return false.  We use the first
    ;; command we find that seems to work.
    ;; The list of commands to try is as follows:
    ;; `ls -d'            This works on most systems, but NetBSD 1.4
    ;;                    has a bug: `ls' always returns zero exit
    ;;                    status, even for files which don't exist.
    ;; `test -e'          Some Bourne shells have a `test' builtin
    ;;                    which does not know the `-e' option.
    ;; `/bin/test -e'     For those, the `test' binary on disk normally
    ;;                    provides the option.  Alas, the binary
    ;;                    is sometimes `/bin/test' and sometimes it's
    ;;                    `/usr/bin/test'.
    ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
    (unless (or
             (and (setq result (format "%s -e" (tramp-get-test-command vec)))
    (condition-case nil
        (tramp-send-command-and-check
         vec (format "%s %s" result existing))
      (error nil))
    (condition-case nil
        (not (tramp-send-command-and-check
       vec (format "%s %s" result nonexistent)))
      (error nil)))
             (and (setq result "/bin/test -e")
    (condition-case nil
        (tramp-send-command-and-check
         vec (format "%s %s" result existing))
      (error nil))
    (condition-case nil
        (not (tramp-send-command-and-check
       vec (format "%s %s" result nonexistent)))
      (error nil)))
             (and (setq result "/usr/bin/test -e")
    (condition-case nil
        (tramp-send-command-and-check
         vec (format "%s %s" result existing))
      (error nil))
    (condition-case nil
        (not (tramp-send-command-and-check
       vec (format "%s %s" result nonexistent)))
      (error nil)))
             (and (setq result (format "%s -d" (tramp-get-ls-command vec)))
    (condition-case nil
        (tramp-send-command-and-check
         vec (format "%s %s" result existing))
      (error nil))
    (condition-case nil
        (not (tramp-send-command-and-check
       vec (format "%s %s" result nonexistent)))
      (error nil))))
      (tramp-error
       vec 'file-error "Couldn't find command to check if file exists"))
    (tramp-message vec 10 "%s" result)
    result))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]