290 |
(tramp-smb-send-command user host (format "cd \\")) |
(tramp-smb-send-command user host (format "cd \\")) |
291 |
;; Error |
;; Error |
292 |
(tramp-smb-send-command user host (format "cd \\")) |
(tramp-smb-send-command user host (format "cd \\")) |
293 |
(error "Cannot delete file `%s'" directory)))))) |
(error "Cannot delete file `%s'" filename)))))) |
294 |
|
|
295 |
(defun tramp-smb-handle-directory-files |
(defun tramp-smb-handle-directory-files |
296 |
(directory &optional full match nosort) |
(directory &optional full match nosort) |
324 |
entries)))) |
entries)))) |
325 |
|
|
326 |
(defun tramp-smb-handle-directory-files-and-attributes |
(defun tramp-smb-handle-directory-files-and-attributes |
327 |
(directory &optional full match nosort) |
(directory &optional full match nosort id-format) |
328 |
"Like `directory-files-and-attributes' for tramp files." |
"Like `directory-files-and-attributes' for tramp files." |
329 |
(mapcar |
(mapcar |
330 |
(lambda (x) |
(lambda (x) |
331 |
(cons x (file-attributes |
;; We cannot call `file-attributes' for backward compatibility reasons. |
332 |
(if full x (concat (file-name-as-directory directory) x))))) |
;; 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))) |
335 |
(directory-files directory full match nosort))) |
(directory-files directory full match nosort))) |
336 |
|
|
337 |
(defun tramp-smb-handle-file-attributes (filename &optional nonnumeric) |
(defun tramp-smb-handle-file-attributes (filename &optional id-format) |
338 |
"Like `file-attributes' for tramp files. |
"Like `file-attributes' for tramp files." |
|
Optional argument NONNUMERIC means return user and group name |
|
|
rather than as numbers." |
|
339 |
; (with-parsed-tramp-file-name filename nil |
; (with-parsed-tramp-file-name filename nil |
340 |
(let (user host localname) |
(let (user host localname) |
341 |
(with-parsed-tramp-file-name filename l |
(with-parsed-tramp-file-name filename l |
346 |
(entries (tramp-smb-get-file-entries user host share file)) |
(entries (tramp-smb-get-file-entries user host share file)) |
347 |
(entry (and entries |
(entry (and entries |
348 |
(assoc (file-name-nondirectory file) entries))) |
(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)) |
351 |
(inode (tramp-smb-get-inode share file)) |
(inode (tramp-smb-get-inode share file)) |
352 |
(device (tramp-get-device nil tramp-smb-method user host))) |
(device (tramp-get-device nil tramp-smb-method user host))) |
353 |
|
|
356 |
(list (and (string-match "d" (nth 1 entry)) |
(list (and (string-match "d" (nth 1 entry)) |
357 |
t) ;0 file type |
t) ;0 file type |
358 |
-1 ;1 link count |
-1 ;1 link count |
359 |
-1 ;2 uid |
uid ;2 uid |
360 |
-1 ;3 gid |
gid ;3 gid |
361 |
'(0 0) ;4 atime |
'(0 0) ;4 atime |
362 |
(nth 3 entry) ;5 mtime |
(nth 3 entry) ;5 mtime |
363 |
'(0 0) ;6 ctime |
'(0 0) ;6 ctime |
548 |
"Like `make-directory-internal' for tramp files." |
"Like `make-directory-internal' for tramp files." |
549 |
(setq directory (directory-file-name (expand-file-name directory))) |
(setq directory (directory-file-name (expand-file-name directory))) |
550 |
(unless (file-name-absolute-p directory) |
(unless (file-name-absolute-p directory) |
551 |
(setq ldir (concat default-directory directory))) |
(setq directory (concat default-directory directory))) |
552 |
; (with-parsed-tramp-file-name directory nil |
; (with-parsed-tramp-file-name directory nil |
553 |
(let (user host localname) |
(let (user host localname) |
554 |
(with-parsed-tramp-file-name directory l |
(with-parsed-tramp-file-name directory l |