Easy Way to Create Symlinks?
Easy Way to Create Symlinks?
Hi everyone,
I‘d like to create some personal playlists within my console and Arcade specific game directories. As I don‘t want to copy the related games to those new playlist directories I‘d prefer to use shortcuts. I heard that MiSTer uses something called symlinks for that purpose.
What is the easiest way to set those? I‘ve already tried creating symlinks in a MacOS app called „Cyber Duck“ which I also use to transfer games to my MiSTer but those symlinks didn‘t work. I also have a windows pc at hand if that helps.
By the way, I‘m aware of the Arcade organizer script but I want to create some more specific directories and for console games alike.
I‘d appreciate some help very much. Thank you!
I‘d like to create some personal playlists within my console and Arcade specific game directories. As I don‘t want to copy the related games to those new playlist directories I‘d prefer to use shortcuts. I heard that MiSTer uses something called symlinks for that purpose.
What is the easiest way to set those? I‘ve already tried creating symlinks in a MacOS app called „Cyber Duck“ which I also use to transfer games to my MiSTer but those symlinks didn‘t work. I also have a windows pc at hand if that helps.
By the way, I‘m aware of the Arcade organizer script but I want to create some more specific directories and for console games alike.
I‘d appreciate some help very much. Thank you!
-
- Top Contributor
- Posts: 1911
- Joined: Wed May 27, 2020 1:59 pm
- Has thanked: 145 times
- Been thanked: 454 times
Re: Easy Way to Create Symlinks?
You can use Linux command prompt or you can use WinSCP in a way similar of creating shortcuts in windows file explorer. I tend to use WinSCP as I have it always open.
Re: Easy Way to Create Symlinks?
While it doesn't create symlinks, I've been using wizzomafizzo's Favorites script to do something similar, ie. making a folder full of shortcuts to my favorite games that are selectable on the main menu. Maybe it would work for you too!
-
- Top Contributor
- Posts: 860
- Joined: Wed Feb 09, 2022 11:50 pm
- Has thanked: 64 times
- Been thanked: 195 times
Re: Easy Way to Create Symlinks?
The way I normally do that is by using the 'ln' command at the command line. Because most of the Mister system is on a FAT filesystem, you should only use symbolic links, and you can run into weird situations where some links just won't work, you'll get an error message. I have that problem when trying to link, for instance, from my SMB3 /media/fat/cifs filesystem back elsewhere in the hierarchy. I haven't puzzled out what the actual rules are.
To make a symlink, drop to the command line with F9 (or with an SSH connection, which is easier after you have SSH running), and type:
edit: symlinks can also be relative, like this:
or like this:
The ../ goes up one directory. You can use several ../ if you need to go up several directories.
To make a symlink, drop to the command line with F9 (or with an SSH connection, which is easier after you have SSH running), and type:
Code: Select all
ln -s /path/to/target /path/to/symlink
Code: Select all
ln -s ../parentfile symlinkfile
Code: Select all
ln -s subdir/subdirfile symlinkfile
Re: Easy Way to Create Symlinks?
Thank you all for your kind suggestions!
I tried WinSCP and created some symlinks and they all work great
Using relative target paths (../) was important for my desired folder structure so the symlinks refer to the correct paths that contain the original game files.
Only downside is that you can create one symlink at a time only, right? Selecting multiple game files in WinSCP for creating symlinks would be much more convenient.
I tried WinSCP and created some symlinks and they all work great
Using relative target paths (../) was important for my desired folder structure so the symlinks refer to the correct paths that contain the original game files.
Only downside is that you can create one symlink at a time only, right? Selecting multiple game files in WinSCP for creating symlinks would be much more convenient.
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: Easy Way to Create Symlinks?
It does! It just a simple wrapper around doing this exact thing, making symlinks. Glad it's working well for you
My script can't link files in bulk but it does remember the last path you were in between linking, so if you want to add a lot of stuff at once you can get into a pretty quick workflow tapping enter through the dialogs. It's a lot faster than doing it manually on the command line anyway. You can try it here: viewtopic.php?t=4470
If you don't like the _@Favorites folder it creates you can just rename it afterwards or move it somewhere else. It's making plain symlinks same as you're doing right now. If you need to symlink *a lot* of stuff then you need to write a bash script or one-liner to do it like this: https://www.diskinternals.com/linux-rea ... -one-line/
Re: Easy Way to Create Symlinks?
Thanks a lot for this clarification! I am looking forward to try out your Favourites script then
Re: Easy Way to Create Symlinks?
Today I tried your Favourites script and it worked great for me regarding Arcade games! It really is a lot faster. I just went through all the games creating a bunch of symlinks and sorted them in my personal folders afterwards. I especially like that your script always returns to the last entry a symlink was created for. Very handy, thank youwizzo wrote: ↑Sun Aug 21, 2022 5:38 pm
My script can't link files in bulk but it does remember the last path you were in between linking, so if you want to add a lot of stuff at once you can get into a pretty quick workflow tapping enter through the dialogs.
If you don't like the _@Favorites folder it creates you can just rename it afterwards or move it somewhere else.
One question though. Regarding console games it seems that your script creates mgl-files only. As I‘d like to select games within the core menues I prefer symlinks here too. Is it possible like with arcade games?
- wizzo
- Scripting Wizard
- Posts: 183
- Joined: Sat Mar 12, 2022 11:32 am
- Has thanked: 15 times
- Been thanked: 243 times
Re: Easy Way to Create Symlinks?
It is not possible sorry. It's something I could consider adding support for but would need some investigation. In my experience with trying to symlink ISOs I found I wasn't able to launch them from the core's own launcher menu.