fuse-archive icon indicating copy to clipboard operation
fuse-archive copied to clipboard

Empty folders not mounted

Open mattmart3 opened this issue 2 years ago • 2 comments

I am noticing that if a tar.gz archive contains empty folders, these are not mounted. Is this behavior intended or am I missing something?

Here how to reproduce:

  1. Create test archive
$ mkdir test-fuse-archive
$ mkdir -p test-fuse-archive/dir1/dir1.1
$ mkdir -p test-fuse-archive/dir2/dir2.1
$ echo "existing file" > test-fuse-archive/dir2/dir2.1/file

$ find test-fuse-archive 
test-fuse-archive
test-fuse-archive/dir2
test-fuse-archive/dir2/dir2.1
test-fuse-archive/dir2/dir2.1/file
test-fuse-archive/dir1
test-fuse-archive/dir1/dir1.1
  1. The empty folder is properly extracted by tar
$ mkdir out_tgz && tar xvaf test_fuse_archive.tgz -C out_tgz
$ find out_tgz 
out_tgz
out_tgz/test-fuse-archive
out_tgz/test-fuse-archive/dir2
out_tgz/test-fuse-archive/dir2/dir2.1
out_tgz/test-fuse-archive/dir2/dir2.1/file
out_tgz/test-fuse-archive/dir1
out_tgz/test-fuse-archive/dir1/dir1.1
  1. fuse-archive doesn't mount neither the empty folder dir1.1 nor its parent folder dir1:
git clone https://github.com/google/fuse-archive.git -b v0.1.14
cd fuse-archive
make
./out/fuse-archive ~/test_fuse_archive.tgz /mnt/tmp
find /mnt/tmp
/mnt/tmp
/mnt/tmp/test-fuse-archive
/mnt/tmp/test-fuse-archive/dir2
/mnt/tmp/test-fuse-archive/dir2/dir2.1
/mnt/tmp/test-fuse-archive/dir2/dir2.1/file

Feel free to close the issue if this is the intended behavior.

mattmart3 avatar Jul 31 '23 16:07 mattmart3

Thanks Matteo for the detailed bug report.

I confirm that I can reproduce the issue. Indeed, empty folders, or even folder trees that don't contain any file, are not visible in the mounted archive.

fdegros avatar Aug 01 '23 02:08 fdegros

Assigning to Nigel, who has a more in-depth knowledge of how fuse-archive works.

fdegros avatar Aug 01 '23 03:08 fdegros

See the following verification steps.

Create a test archive containing an empty folder:

$ mkdir test-fuse-archive
$ mkdir -p test-fuse-archive/dir1/dir1.1
$ mkdir -p test-fuse-archive/dir2/dir2.1
$ echo "existing file" > test-fuse-archive/dir2/dir2.1/file
$ tree test-fuse-archive/
test-fuse-archive/
├── dir1
│   └── dir1.1
└── dir2
    └── dir2.1
        └── file

5 directories, 1 file

$ tar czf test_fuse_archive.tgz test-fuse-archive/

Mount the test archive with fuse-archive:

$ mkdir -p mnt
$ fuse-archive test_fuse_archive.tgz mnt
fuse-archive: Using existing mount point 'mnt'

Check that the mounted archive contains all the expected folders, including the empty ones.

$ tree mnt
mnt
└── test-fuse-archive
    ├── dir1
    │   └── dir1.1
    └── dir2
        └── dir2.1
            └── file

6 directories, 1 file

fdegros avatar Sep 26 '24 03:09 fdegros