yorukot / superfile

Pretty fancy and modern terminal file manager
https://superfile.netlify.app
MIT License
4.85k stars 101 forks source link

External media error when moving cursor #22

Closed lescx closed 2 months ago

lescx commented 2 months ago

Each time I move the cursor, I get the following error in superfile.log:

2024/04/09 09:00:34 Get external media error
2024/04/09 09:00:34 open /run/media/luca: no such file or directory

There is no /run/media folder on my system.

OS: Debian 12 (bookworm) spf: v1.0.1

AnshumanNeon commented 2 months ago

Screenshot 2024-04-09 at 2 25 11 PM this is the part that causes problem. This is in the function.go file, in the getFolder function. this function basically returns a list of all folders within a specified path. that specified path is "/run/media/YOUR_USER_NAME" because it tries to access a folder in /run/media and there is none on your system, it fails.

/run/media is commonly used on arch linux. it is used to mount media from external hdd and storage devices. Considering the amount of ricing MHNCat did to their arch linux distro, i can safely assume that they mounted their media to /run/media/ using a hdd. MHNCat's commit's also suggest something similar.

But I am using a macos and I don't have a /run/media folder too. I don't get such an error. my system: macos catalina 10.15.7

yorukot commented 2 months ago

I think I need to find a better way to identify external hard drives

yorukot commented 2 months ago

Seems like MacOs external disk is under /Volumes?

yorukot commented 2 months ago

I fixed this here

But I didn't test MacOs, so if you can, please test it for me and report back. Thanks!!

AnshumanNeon commented 2 months ago

Seems like MacOs external disk is under /Volumes?

Yes

AnshumanNeon commented 2 months ago

i will test it on macos, but idk how i will cuz that bug never happened to me

yorukot commented 2 months ago

Hmmm maybe you can try does the external disk work on MacOs? I think it should not work on macos before.

AnshumanNeon commented 2 months ago

i don't think I have any external disks. I need to search for them, if I need to test them

yorukot commented 2 months ago

Oh that's okay! just wait for someone to test it.

I really appreciate your help!

lescx commented 2 months ago

@AnshumanNeon You could mkdir + mount a directory in /Volumes. No need to plug in a hard drive.

AnshumanNeon commented 2 months ago

well the data disk wasn't appearing earlier but now it is. So I think it is working fine. I can go inside it and it doesn't crash.

yorukot commented 2 months ago

Ok i think we can close this issue!