Mercurial > emacs
comparison lisp/net/tramp-smb.el @ 53206:0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Charles Curley <charlescurley@charlescurley.com>.
(tramp-multi-connection-function-alist): Add ssht entry which adds
"-e none -t -t" to the list of ssh args. Suggested by Adrian
Aichner.
(tramp-get-method-parameter): New function to retrieve a method
parameter. This allows for omission of method parameters.
Callers adjusted.
author | Kai Großjohann <kgrossjo@eu.uu.net> |
---|---|
date | Sun, 30 Nov 2003 18:15:22 +0000 |
parents | 695cf19ef79e |
children | c1bfc266f10a |
comparison
equal
deleted
inserted
replaced
53205:ed27adf8b7ac | 53206:0c19f1a19b2b |
---|---|
288 (tramp-smb-send-command user host (format "rm \"%s\"" file))) | 288 (tramp-smb-send-command user host (format "rm \"%s\"" file))) |
289 ;; Go Home | 289 ;; Go Home |
290 (tramp-smb-send-command user host (format "cd \\")) | 290 (tramp-smb-send-command user host (format "cd \\")) |
291 ;; Error | 291 ;; Error |
292 (tramp-smb-send-command user host (format "cd \\")) | 292 (tramp-smb-send-command user host (format "cd \\")) |
293 (error "Cannot delete file `%s'" directory)))))) | 293 (error "Cannot delete file `%s'" filename)))))) |
294 | 294 |
295 (defun tramp-smb-handle-directory-files | 295 (defun tramp-smb-handle-directory-files |
296 (directory &optional full match nosort) | 296 (directory &optional full match nosort) |
297 "Like `directory-files' for tramp files." | 297 "Like `directory-files' for tramp files." |
298 (setq directory (directory-file-name (expand-file-name directory))) | 298 (setq directory (directory-file-name (expand-file-name directory))) |
322 (unless nosort (setq entries (sort entries 'string-lessp))) | 322 (unless nosort (setq entries (sort entries 'string-lessp))) |
323 ;; That's it | 323 ;; That's it |
324 entries)))) | 324 entries)))) |
325 | 325 |
326 (defun tramp-smb-handle-directory-files-and-attributes | 326 (defun tramp-smb-handle-directory-files-and-attributes |
327 (directory &optional full match nosort) | 327 (directory &optional full match nosort id-format) |
328 "Like `directory-files-and-attributes' for tramp files." | 328 "Like `directory-files-and-attributes' for tramp files." |
329 (mapcar | 329 (mapcar |
330 (lambda (x) | 330 (lambda (x) |
331 (cons x (file-attributes | 331 ;; We cannot call `file-attributes' for backward compatibility reasons. |
332 (if full x (concat (file-name-as-directory directory) x))))) | 332 ;; Its optional parameter ID-FORMAT is introduced with Emacs 21.4. |
333 (cons x (tramp-smb-handle-file-attributes | |
334 (if full x (concat (file-name-as-directory directory) x)) id-format))) | |
333 (directory-files directory full match nosort))) | 335 (directory-files directory full match nosort))) |
334 | 336 |
335 (defun tramp-smb-handle-file-attributes (filename &optional nonnumeric) | 337 (defun tramp-smb-handle-file-attributes (filename &optional id-format) |
336 "Like `file-attributes' for tramp files. | 338 "Like `file-attributes' for tramp files." |
337 Optional argument NONNUMERIC means return user and group name | |
338 rather than as numbers." | |
339 ; (with-parsed-tramp-file-name filename nil | 339 ; (with-parsed-tramp-file-name filename nil |
340 (let (user host localname) | 340 (let (user host localname) |
341 (with-parsed-tramp-file-name filename l | 341 (with-parsed-tramp-file-name filename l |
342 (setq user l-user host l-host localname l-localname)) | 342 (setq user l-user host l-host localname l-localname)) |
343 (save-excursion | 343 (save-excursion |
344 (let* ((share (tramp-smb-get-share localname)) | 344 (let* ((share (tramp-smb-get-share localname)) |
345 (file (tramp-smb-get-localname localname nil)) | 345 (file (tramp-smb-get-localname localname nil)) |
346 (entries (tramp-smb-get-file-entries user host share file)) | 346 (entries (tramp-smb-get-file-entries user host share file)) |
347 (entry (and entries | 347 (entry (and entries |
348 (assoc (file-name-nondirectory file) entries))) | 348 (assoc (file-name-nondirectory file) entries))) |
349 (uid (if (and id-format (equal id-format 'string)) "nobody" -1)) | |
350 (gid (if (and id-format (equal id-format 'string)) "nogroup" -1)) | |
349 (inode (tramp-smb-get-inode share file)) | 351 (inode (tramp-smb-get-inode share file)) |
350 (device (tramp-get-device nil tramp-smb-method user host))) | 352 (device (tramp-get-device nil tramp-smb-method user host))) |
351 | 353 |
352 ; check result | 354 ; check result |
353 (when entry | 355 (when entry |
354 (list (and (string-match "d" (nth 1 entry)) | 356 (list (and (string-match "d" (nth 1 entry)) |
355 t) ;0 file type | 357 t) ;0 file type |
356 -1 ;1 link count | 358 -1 ;1 link count |
357 -1 ;2 uid | 359 uid ;2 uid |
358 -1 ;3 gid | 360 gid ;3 gid |
359 '(0 0) ;4 atime | 361 '(0 0) ;4 atime |
360 (nth 3 entry) ;5 mtime | 362 (nth 3 entry) ;5 mtime |
361 '(0 0) ;6 ctime | 363 '(0 0) ;6 ctime |
362 (nth 2 entry) ;7 size | 364 (nth 2 entry) ;7 size |
363 (nth 1 entry) ;8 mode | 365 (nth 1 entry) ;8 mode |
544 | 546 |
545 (defun tramp-smb-handle-make-directory-internal (directory) | 547 (defun tramp-smb-handle-make-directory-internal (directory) |
546 "Like `make-directory-internal' for tramp files." | 548 "Like `make-directory-internal' for tramp files." |
547 (setq directory (directory-file-name (expand-file-name directory))) | 549 (setq directory (directory-file-name (expand-file-name directory))) |
548 (unless (file-name-absolute-p directory) | 550 (unless (file-name-absolute-p directory) |
549 (setq ldir (concat default-directory directory))) | 551 (setq directory (concat default-directory directory))) |
550 ; (with-parsed-tramp-file-name directory nil | 552 ; (with-parsed-tramp-file-name directory nil |
551 (let (user host localname) | 553 (let (user host localname) |
552 (with-parsed-tramp-file-name directory l | 554 (with-parsed-tramp-file-name directory l |
553 (setq user l-user host l-host localname l-localname)) | 555 (setq user l-user host l-host localname l-localname)) |
554 (save-match-data | 556 (save-match-data |