;; file is created. Do it directly.
(if (and (stringp start) (string-empty-p start))
(tramp-adb-send-command-and-check
- v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname)))
+ v (format "echo -n \"\" >%s" (tramp-shell-quote-argument localname)))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(when (and append (file-exists-p filename))
;; file is created. Do it directly.
(if (and (stringp start) (string-empty-p start))
(tramp-send-command
- v (format "echo -n \"\">%s" (tramp-shell-quote-argument localname)))
+ v (format "cat <%s >%s"
+ (tramp-get-remote-null-device v)
+ (tramp-shell-quote-argument localname)))
;; Short track: if we are on the local host, we can run directly.
(if (and (tramp-local-host-p v)
(put #'tramp-file-name-port-or-default 'tramp-suppress-trace t)
;;;###tramp-autoload
-(defun tramp-file-name-unify (vec &optional file)
+(defun tramp-file-name-unify (vec &optional localname)
"Unify VEC by removing localname and hop from `tramp-file-name' structure.
-If FILE is a string, set it as localname.
+If LOCALNAME is a string, set it as localname.
Objects returned by this function compare `equal' if they refer to the
same connection. Make a copy in order to avoid side effects."
(when (tramp-file-name-p vec)
(setq vec (copy-tramp-file-name vec))
(setf (tramp-file-name-localname vec)
- (and (stringp file)
+ (and (stringp localname)
;; FIXME: This is a sanity check. When this error
;; doesn't happen for a while, it can be removed.
- (or (file-name-absolute-p file)
+ (or (file-name-absolute-p localname)
(tramp-error
- vec 'file-error "File `%s' must be absolute" file))
- (directory-file-name (tramp-compat-file-name-unquote file)))
+ vec 'file-error "File `%s' must be absolute" localname))
+ (tramp-compat-file-name-unquote (directory-file-name localname)))
(tramp-file-name-hop vec) nil))
vec)