mafintosh/fuse-bindings

paths are sliced when arriving to FUSE operations

Opened this issue · 1 comments

I have a C based backend application that can only work with local filesystem paths.
In order for my application to work with assets located on the internet, I'm converting urls from this:
https://somethingontheinternet.com/assets/Computer_33200.mp4
to this
/mnt/https/aHR0cHM6Ly9zb21ldGhpbmdvbnRoZWludGVybmV0LmNvbS9hc3NldHMvQ29tcHV0ZXJfMzMyMDAubXA0.mp4
(some base64 encoding manipulation)
this way, my application is "reading" local fs files but my fuse-bindings hooks are kicking in and converting the local path to the remote path and fetching the item from the internet.
Sometimes i'll run into long urls, for example :-):
https://somethingontheinternet.com/very/very/very/long/path/until/someday/finally/reaching/the/gaddamn/assets/goesonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandon/Computer_33200.mp4
the local fs will look like this:
/mnt/https/aHR0cHM6Ly9zb21ldGhpbmdvbnRoZWludGVybmV0LmNvbS92ZXJ5L3ZlcnkvdmVyeS9sb25nL3BhdGgvdW50aWwvc29tZWRheS9maW5hbGx5L3JlYWNoaW5nL3RoZS9nYWRkYW1uL2Fzc2V0cy9nb2Vzb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW/5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbi9Db21wdXRlcl8zMzIwMC5tcDQ.mp4
(a 363 long path)
When this path goes into my hook, it's sliced from after 255 characters:
/mnt/https/aHR0cHM6Ly9zb21ldGhpbmdvbnRoZWludGVybmV0LmNvbS92ZXJ5L3ZlcnkvdmVyeS9sb25nL3BhdGgvdW50aWwvc29tZWRheS9maW5hbGx5L3JlYWNoaW5nL3RoZS9nYWRkYW1uL2Fzc2V0cy9nb2Vzb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFuZG9uYW5kb25hbmRvbmFu
According to my understanding, I have a 4096 chars max path limit in linux, so how come i don;'t have the same limit in my mounted FS?

I believe it is limited to 255 characters because that is all that is supported on all 3 platforms e.g. windows. This is going off of memory though.