Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support searching in AVFS #1572

Open
CarlOlson opened this issue Jun 10, 2024 · 1 comment
Open

Support searching in AVFS #1572

CarlOlson opened this issue Jun 10, 2024 · 1 comment

Comments

@CarlOlson
Copy link

A Virtual File System is a common way to access archives as a filesystem. Currently I don't know of any tool that will find files inside archives inside a mounted avfs folder. With many package managers using archives it would be helpful to find files inside archives with fd.

Example:

$ mountavfs
Mounting AVFS on /home/<user>/.avfs...

$ fd <file> ~/.avfs/home/<user>/dir
/home/<user>/.avfs/home/<user>/dir/archive.zip#/dir/<file>

I'd expect fd to check the filesystem of the directory. If it is avfs then it would search inside archives with the #/ suffix.

Currently fd will only search if started inside an archive with a folder:

$ fd <file> ~/.avfs/home/<user>/dir/archive.zip#/

$ fd <file> ~/.avfs/home/<user>/dir/archive.zip#/dir
/home/<user>/.avfs/home/<user>/dir/archive.zip#/dir/<file>
@tavianator
Copy link
Collaborator

Hmm, in my experience it's slightly different:

tavianator@graphene $ fd ioq .avfs/home/tavianator/Downloads
tavianator@graphene $ fd ioq .avfs/home/tavianator/Downloads/bfs-3.2.tar.gz\#
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/src/ioq.c
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/src/ioq.h
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/tests/ioq.c
tavianator@graphene $ fd ioq .avfs/home/tavianator/Downloads/bfs-3.2.tar.gz\#/bfs-3.2
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/src/ioq.c
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/src/ioq.h
.avfs/home/tavianator/Downloads/bfs-3.2.tar.gz#/bfs-3.2/tests/ioq.c

This happens because the ...# virtual directories don't show up in a directory listing (e.g. with ls .avfs/...). It's theoretically possible for fd to special-case AVFS and add the ...# entries itself, but I don't think it's worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants