Empty folders not mounted
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:
- 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
- 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
fuse-archivedoesn't mount neither the empty folderdir1.1nor its parent folderdir1:
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.
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.
Assigning to Nigel, who has a more in-depth knowledge of how fuse-archive works.
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