fangfufu / httpdirfs

A filesystem which allows you to mount HTTP directory listings or a single file, with a permanent cache. Now with Airsonic / Subsonic support!
Other
763 stars 59 forks source link

Need help with single-file-mode #156

Closed redindian closed 2 months ago

redindian commented 2 months ago

Hi and thanks for this great package!

I compiled it on Ubuntu 22.04 LTS without problems, but whatever I try, I can't seem to get single-file-mode to work.

First I create a file to mount to:

touch ubuntu-22.04.4-live-server-amd64.iso

Then I try to mount the Ubuntu ISO:

httpdirfs -f --cache --single-file-mode https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso ubuntu-22.04.4-live-server-amd64.iso 

LinkTable_print: --------------------------------------------
LinkTable_print:  LinkTable 0x5615553731f0 for https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso
LinkTable_print: --------------------------------------------
LinkTable_print: 0 H 0  https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso
LinkTable_print: 1 F 2104408064 ubuntu-22.04.4-live-server-amd64.iso https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso
LinkTable_print: --------------------------------------------
LinkTable_print:  Invalid link count: 0
LinkTable_print: --------------------------------------------

But when I try to ls the directory I get an input/output error:

ls: cannot access 'ubuntu-22.04.4-live-server-amd64.iso': Input/output error

Tried also with/without --cache and --no-range-check.

It should support ranges I think according to the headers:

curl -I https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso

HTTP/1.1 200 OK
Date: Thu, 18 Jul 2024 17:58:39 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Fri, 16 Feb 2024 23:52:36 GMT
ETag: "7d6eb800-61188703a4abd"
Accept-Ranges: bytes
Content-Length: 2104408064
Content-Type: application/x-iso9660-image

Any help or an example would be greatly appreciated. :-)

fangfufu commented 2 months ago

You need to create the mountpoint by using mkdir.

You could do something like:

$ mkdir test
$ ./httpdirfs -f --cache --single-file-mode https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso test
redindian commented 2 months ago

Now I feel stupid, haha. Thanks for the quick reply, works perfectly now! 👍