diff options
author | Alexandre Bury <alexandre.bury@gmail.com> | 2019-06-24 01:13:36 +0000 |
---|---|---|
committer | Alexandre Bury <alexandre.bury@gmail.com> | 2019-06-24 01:14:05 +0000 |
commit | 9035e288d175a73485456f4f23a6395fe9f6ec2e (patch) | |
tree | 851b6f2d56433b11d71c2c733b334df2648688ec /src | |
parent | Add module documentation on src/pipe.r (diff) | |
download | miniserve-9035e288d175a73485456f4f23a6395fe9f6ec2e.tar.gz miniserve-9035e288d175a73485456f4f23a6395fe9f6ec2e.zip |
Precise `tar_dir` behaviour
Diffstat (limited to '')
-rw-r--r-- | src/archive.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/archive.rs b/src/archive.rs index f76d55c..268bb47 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -85,7 +85,26 @@ where /// Write a tarball of `dir` in `out`. /// /// The target directory will be saved as a top-level directory in the archive. -/// For example, if given `"a/b/c"`, it will be stored as just `"c"` in the archive. +/// +/// For example, consider this directory structure: +/// +/// ``` +/// a +/// └── b +/// └── c +/// ├── e +/// ├── f +/// └── g +/// ``` +/// +/// Making a tarball out of `"a/b/c"` will result in this archive content: +/// +/// ``` +/// c +/// ├── e +/// ├── f +/// └── g +/// ``` fn tar_dir<W>(dir: &Path, skip_symlinks: bool, out: W) -> Result<(), ContextualError> where W: std::io::Write, |