diff options
| author | Michael Albinus | 2017-12-09 14:34:30 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-12-09 14:34:30 +0100 |
| commit | d338325c2b603db8433c9b6b12216201d5ee21e9 (patch) | |
| tree | c422d02f6b228e53654718eacaef04642a9ea3ff /doc/misc | |
| parent | 2ffdc041b1671e064df5ae6f7ec2f5a90c9dd30c (diff) | |
| download | emacs-d338325c2b603db8433c9b6b12216201d5ee21e9.tar.gz emacs-d338325c2b603db8433c9b6b12216201d5ee21e9.zip | |
Support for archive file names
* doc/misc/tramp.texi (Top, Usage): Add entry "Archive file names".
(History): Mention archive file names.
(GVFS based methods): Mentio "http" and "https" methods.
(Archive file names): New node.
(Frequently Asked Questions): Add Emacs 27 as supported version.
* etc/NEWS: Mention tramp-archive.el.
* lisp/net/tramp.el (tramp-run-real-handler)
(tramp-register-file-name-handlers)
(tramp-register-file-name-handlers, tramp-unload-file-name-handlers):
Add `tramp-archive-file-name-handler'.
(tramp-handle-file-name-completion): Do not insist in Tramp
file names.
* lisp/net/tramp-archive.el: New package.
* lisp/net/tramp-cache.el (tramp-dump-connection-properties): Check for
"archive" method.
* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections): Cleanup also
local copies of archives.
* lisp/net/tramp-compat.el (tramp-compat-use-url-tramp-p): New defconst.
* lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "http" and "https".
(tramp-gvfs-gio-mapping): Add "gvfs-mount".
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Handle "uri" and "http".
(tramp-gvfs-unmount): New defun.
* test/lisp/net/tramp-archive-tests.el: New package.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/tramp.texi | 216 |
1 files changed, 213 insertions, 3 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index e7d9cb15dee..3869e19fb96 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -164,6 +164,7 @@ Using @value{tramp} | |||
| 164 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. | 164 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. |
| 165 | * Remote processes:: Integration with other Emacs packages. | 165 | * Remote processes:: Integration with other Emacs packages. |
| 166 | * Cleanup remote connections:: Cleanup remote connections. | 166 | * Cleanup remote connections:: Cleanup remote connections. |
| 167 | * Archive file names:: Access to files in file archives. | ||
| 167 | 168 | ||
| 168 | How file names, directories and localnames are mangled and managed | 169 | How file names, directories and localnames are mangled and managed |
| 169 | 170 | ||
| @@ -407,7 +408,8 @@ since April 2007 (and removed in December 2016). GVFS integration | |||
| 407 | started in February 2009. Remote commands on MS Windows hosts since | 408 | started in February 2009. Remote commands on MS Windows hosts since |
| 408 | September 2011. Ad-hoc multi-hop methods (with a changed syntax) | 409 | September 2011. Ad-hoc multi-hop methods (with a changed syntax) |
| 409 | re-enabled in November 2011. In November 2012, added Juergen | 410 | re-enabled in November 2011. In November 2012, added Juergen |
| 410 | Hoetzel's @file{tramp-adb.el}. | 411 | Hoetzel's @file{tramp-adb.el}. Archive file names are supported since |
| 412 | December 2017. | ||
| 411 | 413 | ||
| 412 | XEmacs support was stopped in January 2016. Since March 2017, | 414 | XEmacs support was stopped in January 2016. Since March 2017, |
| 413 | @value{tramp} syntax mandates a method. | 415 | @value{tramp} syntax mandates a method. |
| @@ -1134,7 +1136,10 @@ requires the SYNCE-GVFS plugin. | |||
| 1134 | This user option is a list of external methods for GVFS@. By default, | 1136 | This user option is a list of external methods for GVFS@. By default, |
| 1135 | this list includes @option{afp}, @option{dav}, @option{davs}, | 1137 | this list includes @option{afp}, @option{dav}, @option{davs}, |
| 1136 | @option{gdrive}, @option{obex}, @option{sftp} and @option{synce}. | 1138 | @option{gdrive}, @option{obex}, @option{sftp} and @option{synce}. |
| 1137 | Other methods to include are: @option{ftp} and @option{smb}. | 1139 | Other methods to include are @option{ftp}, @option{http}, |
| 1140 | @option{https} and @option{smb}. These methods are not intended to be | ||
| 1141 | used directly as GVFS based method. Instead, they are added here for | ||
| 1142 | the benefit of @ref{Archive file names}. | ||
| 1138 | @end defopt | 1143 | @end defopt |
| 1139 | 1144 | ||
| 1140 | 1145 | ||
| @@ -2284,6 +2289,7 @@ is a feature of Emacs that may cause missed prompts when using | |||
| 2284 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. | 2289 | * Ad-hoc multi-hops:: Declaring multiple hops in the file name. |
| 2285 | * Remote processes:: Integration with other Emacs packages. | 2290 | * Remote processes:: Integration with other Emacs packages. |
| 2286 | * Cleanup remote connections:: Cleanup remote connections. | 2291 | * Cleanup remote connections:: Cleanup remote connections. |
| 2292 | * Archive file names:: Access to files in file archives. | ||
| 2287 | @end menu | 2293 | @end menu |
| 2288 | 2294 | ||
| 2289 | 2295 | ||
| @@ -2913,6 +2919,209 @@ that remote connection. | |||
| 2913 | @end deffn | 2919 | @end deffn |
| 2914 | 2920 | ||
| 2915 | 2921 | ||
| 2922 | @node Archive file names | ||
| 2923 | @section Archive file names | ||
| 2924 | @cindex file archives | ||
| 2925 | @cindex archive file names | ||
| 2926 | @cindex method archive | ||
| 2927 | @cindex archive method | ||
| 2928 | |||
| 2929 | @value{tramp} offers also transparent access to files inside file | ||
| 2930 | archives. This is possible only on machines which have installed the | ||
| 2931 | virtual file system for the Gnome Desktop (GVFS), @ref{GVFS based | ||
| 2932 | methods}. Internally, file archives are mounted via the GVFS | ||
| 2933 | @option{archive} method. | ||
| 2934 | |||
| 2935 | A file archive is a regular file of kind @file{/path/to/dir/file.EXT}. | ||
| 2936 | The extension @samp{.EXT} identifies the type of the file archive. A | ||
| 2937 | file inside a file archive, called archive file name, has the name | ||
| 2938 | @file{/path/to/dir/file.EXT/dir/file}. | ||
| 2939 | |||
| 2940 | Most of the @ref{Magic File Names, , magic file name operations, | ||
| 2941 | elisp}, are implemented for archive file names, exceptions are all | ||
| 2942 | operations which write into a file archive, and process related | ||
| 2943 | operations. Therefore, functions like | ||
| 2944 | |||
| 2945 | @lisp | ||
| 2946 | (copy-file "/path/to/dir/file.tar/dir/file" "/somewhere/else") | ||
| 2947 | @end lisp | ||
| 2948 | |||
| 2949 | @noindent | ||
| 2950 | work out of the box. This is also true for file name completion, and | ||
| 2951 | for libraries like @code{dired} or @code{ediff}, which accept archive | ||
| 2952 | file names as well. | ||
| 2953 | |||
| 2954 | @vindex tramp-archive-suffixes | ||
| 2955 | File archives are identified by the file name extension @samp{.EXT}. | ||
| 2956 | Since GVFS uses internally the library @code{libarchive(3)}, all | ||
| 2957 | suffixes, which are accepted by this library, work also for archive | ||
| 2958 | file names. Accepted suffixes are listed in the constant | ||
| 2959 | @code{tramp-archive-suffixes}. They are | ||
| 2960 | |||
| 2961 | @itemize | ||
| 2962 | @item @samp{.7z} --- | ||
| 2963 | 7-Zip archives | ||
| 2964 | @cindex 7z, file archive suffix | ||
| 2965 | @cindex file archive suffix 7z | ||
| 2966 | |||
| 2967 | @item @samp{.apk} --- | ||
| 2968 | Android package kits | ||
| 2969 | @cindex apk, file archive suffix | ||
| 2970 | @cindex file archive suffix apk | ||
| 2971 | |||
| 2972 | @item @samp{.ar} --- | ||
| 2973 | UNIX archiver formats | ||
| 2974 | @cindex ar, file archive suffix | ||
| 2975 | @cindex file archive suffix ar | ||
| 2976 | |||
| 2977 | @item @samp{.cab}, @samp{.CAB} --- | ||
| 2978 | Microsoft Windows cabinets | ||
| 2979 | @cindex cab, file archive suffix | ||
| 2980 | @cindex CAB, file archive suffix | ||
| 2981 | @cindex file archive suffix cab | ||
| 2982 | @cindex file archive suffix CAB | ||
| 2983 | |||
| 2984 | @item @samp{.cpio} --- | ||
| 2985 | CPIO archives | ||
| 2986 | @cindex cpio, file archive suffix | ||
| 2987 | @cindex file archive suffix cpio | ||
| 2988 | |||
| 2989 | @item @samp{.deb} --- | ||
| 2990 | Debian packages | ||
| 2991 | @cindex deb, file archive suffix | ||
| 2992 | @cindex file archive suffix deb | ||
| 2993 | |||
| 2994 | @item @samp{.depot} --- | ||
| 2995 | HP-UX SD depots | ||
| 2996 | @cindex depot, file archive suffix | ||
| 2997 | @cindex file archive suffix depot | ||
| 2998 | |||
| 2999 | @item @samp{.exe} --- | ||
| 3000 | Self extracting Microsoft Windows EXE files | ||
| 3001 | @cindex exe, file archive suffix | ||
| 3002 | @cindex file archive suffix exe | ||
| 3003 | |||
| 3004 | @item @samp{.iso} --- | ||
| 3005 | ISO 9660 images | ||
| 3006 | @cindex iso, file archive suffix | ||
| 3007 | @cindex file archive suffix iso | ||
| 3008 | |||
| 3009 | @item @samp{.jar} --- | ||
| 3010 | Java archives | ||
| 3011 | @cindex jar, file archive suffix | ||
| 3012 | @cindex file archive suffix jar | ||
| 3013 | |||
| 3014 | @item @samp{.lzh}, @samp{LZH} --- | ||
| 3015 | Microsoft Windows compressed LHA archives | ||
| 3016 | @cindex lzh, file archive suffix | ||
| 3017 | @cindex LZH, file archive suffix | ||
| 3018 | @cindex file archive suffix lzh | ||
| 3019 | @cindex file archive suffix LZH | ||
| 3020 | |||
| 3021 | @item @samp{.mtree} --- | ||
| 3022 | BSD mtree format | ||
| 3023 | @cindex mtree, file archive suffix | ||
| 3024 | @cindex file archive suffix mtree | ||
| 3025 | |||
| 3026 | @item @samp{.pax} --- | ||
| 3027 | Posix archives | ||
| 3028 | @cindex pax, file archive suffix | ||
| 3029 | @cindex file archive suffix pax | ||
| 3030 | |||
| 3031 | @item @samp{.rar} --- | ||
| 3032 | RAR archives | ||
| 3033 | @cindex rar, file archive suffix | ||
| 3034 | @cindex file archive suffix rar | ||
| 3035 | |||
| 3036 | @item @samp{.rpm} --- | ||
| 3037 | Red Hat packages | ||
| 3038 | @cindex rpm, file archive suffix | ||
| 3039 | @cindex file archive suffix rpm | ||
| 3040 | |||
| 3041 | @item @samp{.shar} --- | ||
| 3042 | Shell archives | ||
| 3043 | @cindex shar, file archive suffix | ||
| 3044 | @cindex file archive suffix shar | ||
| 3045 | |||
| 3046 | @item @samp{.tar}, @samp{tbz}, @samp{tgz}, @samp{tlz}, @samp{txz} --- | ||
| 3047 | (Compressed) tape archives | ||
| 3048 | @cindex tar, file archive suffix | ||
| 3049 | @cindex tbz, file archive suffix | ||
| 3050 | @cindex tgz, file archive suffix | ||
| 3051 | @cindex tlz, file archive suffix | ||
| 3052 | @cindex txz, file archive suffix | ||
| 3053 | @cindex file archive suffix tar | ||
| 3054 | @cindex file archive suffix tbz | ||
| 3055 | @cindex file archive suffix tgz | ||
| 3056 | @cindex file archive suffix tlz | ||
| 3057 | @cindex file archive suffix txz | ||
| 3058 | |||
| 3059 | @item @samp{.warc} --- | ||
| 3060 | Web archives | ||
| 3061 | @cindex warc, file archive suffix | ||
| 3062 | @cindex file archive suffix warc | ||
| 3063 | |||
| 3064 | @item @samp{.xar} --- | ||
| 3065 | macOS XAR archives | ||
| 3066 | @cindex xar, file archive suffix | ||
| 3067 | @cindex file archive suffix xar | ||
| 3068 | |||
| 3069 | @item @samp{.xps} --- | ||
| 3070 | Open XML Paper Specification (OpenXPS) documents | ||
| 3071 | @cindex xps, file archive suffix | ||
| 3072 | @cindex file archive suffix xps | ||
| 3073 | |||
| 3074 | @item @samp{.zip}, @samp{.ZIP} --- | ||
| 3075 | ZIP archives | ||
| 3076 | @cindex zip, file archive suffix | ||
| 3077 | @cindex ZIP, file archive suffix | ||
| 3078 | @cindex file archive suffix zip | ||
| 3079 | @cindex file archive suffix ZIP | ||
| 3080 | @end itemize | ||
| 3081 | |||
| 3082 | @vindex tramp-archive-compression-suffixes | ||
| 3083 | File archives could also be compressed, identified by an additional | ||
| 3084 | compression suffix. Valid compression suffixes are listed in the | ||
| 3085 | constant @code{tramp-archive-compression-suffixes}. They are | ||
| 3086 | @samp{.bz2}, @samp{.gz}, @samp{.lrz}, @samp{.lz}, @samp{.lz4}, | ||
| 3087 | @samp{.lzma}, @samp{.lzo}, @samp{.uu}, @samp{.xz} and @samp{.Z}. A | ||
| 3088 | valid archive file name would be | ||
| 3089 | @file{/path/to/dir/file.tar.gz/dir/file}. Even several suffixes in a | ||
| 3090 | row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. | ||
| 3091 | |||
| 3092 | @vindex tramp-archive-all-gvfs-methods | ||
| 3093 | An archive file name could be a remote file name, as in | ||
| 3094 | @file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. | ||
| 3095 | Since all file operations are mapped internally to GVFS operations, | ||
| 3096 | remote file names supported by @code{tramp-gvfs} perform better, | ||
| 3097 | because no local copy of the file archive must be downloaded first. | ||
| 3098 | For example, @samp{/sftp:user@@host:...} performs better than the | ||
| 3099 | similar @samp{/scp:user@@host:...}. See the constant | ||
| 3100 | @code{tramp-archive-all-gvfs-methods} for a complete list of | ||
| 3101 | @code{tramp-gvfs} supported method names. | ||
| 3102 | |||
| 3103 | If @code{url-handler-mode} is enabled, archives could be visited via | ||
| 3104 | URLs, like @file{https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. | ||
| 3105 | This allows complex file operations like | ||
| 3106 | |||
| 3107 | @lisp | ||
| 3108 | @group | ||
| 3109 | (ediff-directories | ||
| 3110 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.1.tar.gz/tramp-2.3.1" | ||
| 3111 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/tramp-2.3.2" "") | ||
| 3112 | @end group | ||
| 3113 | @end lisp | ||
| 3114 | |||
| 3115 | It is even possible to access file archives in file archives, as | ||
| 3116 | |||
| 3117 | @lisp | ||
| 3118 | @group | ||
| 3119 | (find-file | ||
| 3120 | "http://ftp.debian.org/debian/pool/main/c/coreutils/coreutils_8.28-1_amd64.deb/control.tar.gz/control") | ||
| 3121 | @end group | ||
| 3122 | @end lisp | ||
| 3123 | |||
| 3124 | |||
| 2916 | @node Bug Reports | 3125 | @node Bug Reports |
| 2917 | @chapter Reporting Bugs and Problems | 3126 | @chapter Reporting Bugs and Problems |
| 2918 | @cindex bug reports | 3127 | @cindex bug reports |
| @@ -2997,7 +3206,8 @@ Where is the latest @value{tramp}? | |||
| 2997 | @item | 3206 | @item |
| 2998 | Which systems does it work on? | 3207 | Which systems does it work on? |
| 2999 | 3208 | ||
| 3000 | The package works successfully on Emacs 24, Emacs 25, and Emacs 26. | 3209 | The package works successfully on Emacs 24, Emacs 25, Emacs 26, and |
| 3210 | Emacs 27. | ||
| 3001 | 3211 | ||
| 3002 | While Unix and Unix-like systems are the primary remote targets, | 3212 | While Unix and Unix-like systems are the primary remote targets, |
| 3003 | @value{tramp} has equal success connecting to other platforms, such as | 3213 | @value{tramp} has equal success connecting to other platforms, such as |