108 |
This variable is local to each buffer.") |
This variable is local to each buffer.") |
109 |
(make-variable-buffer-local 'tramp-smb-process-running) |
(make-variable-buffer-local 'tramp-smb-process-running) |
110 |
|
|
|
(defvar tramp-smb-devices nil |
|
|
"Keeps virtual device numbers for SMB hosts.") |
|
|
|
|
111 |
(defvar tramp-smb-inodes nil |
(defvar tramp-smb-inodes nil |
112 |
"Keeps virtual inodes numbers for SMB files.") |
"Keeps virtual inodes numbers for SMB files.") |
113 |
|
|
347 |
(entry (and entries |
(entry (and entries |
348 |
(assoc (file-name-nondirectory file) entries))) |
(assoc (file-name-nondirectory file) entries))) |
349 |
(inode (tramp-smb-get-inode share file)) |
(inode (tramp-smb-get-inode share file)) |
350 |
(device (tramp-smb-get-device user host))) |
(device (tramp-get-device nil tramp-smb-method user host))) |
351 |
|
|
352 |
; check result |
; check result |
353 |
(when entry |
(when entry |
356 |
-1 ;1 link count |
-1 ;1 link count |
357 |
-1 ;2 uid |
-1 ;2 uid |
358 |
-1 ;3 gid |
-1 ;3 gid |
359 |
(nth 3 entry) ;4 atime |
'(0 0) ;4 atime |
360 |
(nth 3 entry) ;5 mtime |
(nth 3 entry) ;5 mtime |
361 |
(nth 3 entry) ;6 ctime |
'(0 0) ;6 ctime |
362 |
(nth 2 entry) ;7 size |
(nth 2 entry) ;7 size |
363 |
(nth 1 entry) ;8 mode |
(nth 1 entry) ;8 mode |
364 |
nil ;9 gid weird |
nil ;9 gid weird |
538 |
(make-directory ldir parents)) |
(make-directory ldir parents)) |
539 |
;; Just do it |
;; Just do it |
540 |
(when (file-directory-p ldir) |
(when (file-directory-p ldir) |
541 |
(tramp-smb-handle-make-directory-internal dir)) |
(make-directory-internal dir)) |
542 |
(unless (file-directory-p dir) |
(unless (file-directory-p dir) |
543 |
(error "Couldn't make directory %s" dir)))))) |
(error "Couldn't make directory %s" dir)))))) |
544 |
|
|
828 |
|
|
829 |
;; size |
;; size |
830 |
(if (string-match "\\([0-9]+\\)$" line) |
(if (string-match "\\([0-9]+\\)$" line) |
831 |
(setq size (match-string 1 line) |
(setq |
832 |
line (substring line 0 (- (max 8 (1+ (length size)))))) |
size (string-to-number (match-string 1 line)) |
833 |
|
line (substring |
834 |
|
line 0 (- (max 8 (1+ (length (match-string 1 line))))))) |
835 |
(return)) |
(return)) |
836 |
|
|
837 |
;; mode |
;; mode |
862 |
'(0 0))) |
'(0 0))) |
863 |
(list path mode size mtime)))) |
(list path mode size mtime)))) |
864 |
|
|
865 |
;; Device and inode don't exist for SMB files. Therefore we must generate |
;; Inodes don't exist for SMB files. Therefore we must generate virtual ones. |
866 |
;; virtual ones. Used in `find-buffer-visiting'. |
;; Used in `find-buffer-visiting'. |
867 |
;; The method applied might be not so efficient (Ange-FTP uses hashes). But |
;; The method applied might be not so efficient (Ange-FTP uses hashes). But |
868 |
;; performance isn't the major issue given that file transfer will take time. |
;; performance isn't the major issue given that file transfer will take time. |
869 |
|
|
|
(defun tramp-smb-get-device (user host) |
|
|
"Returns the virtual device number. |
|
|
If it doesn't exist, generate a new one." |
|
|
(let ((string (if user (concat user "@" host) host))) |
|
|
(unless (assoc string tramp-smb-devices) |
|
|
(add-to-list 'tramp-smb-devices |
|
|
(list string (length tramp-smb-devices)))) |
|
|
(nth 1 (assoc string tramp-smb-devices)))) |
|
|
|
|
870 |
(defun tramp-smb-get-inode (share file) |
(defun tramp-smb-get-inode (share file) |
871 |
"Returns the virtual inode number. |
"Returns the virtual inode number. |
872 |
If it doesn't exist, generate a new one." |
If it doesn't exist, generate a new one." |