3.3 Links file & virtual directories
What is a links file ?
Look below



You may have already seen the yellow icon with a red arrow if you are familiar with FTP and wondered how it was done.
In fact, it is one of the easiest thing to do but sometimes obscure for beginners.

What do we need ?

- Directory/Cdrom drive/harddrive to share
- Access to this directory for the concerned user
- Notepad.exe to edit the link file

That's all !

For example, imagine that you would allow access to your CD-Rom drive G:\ for a user named "Demo".
- The first thing to do is to give the user access to G:\
- Create a new file with notepad : we will call it "demo_links.txt"
- Add an alias to "G:\" in this file :
We will call the alias "My Secret Files"
In "demo_links.txt" simply add :
My Secret Files | G:\
(Note : | is reached via "Alt Gr+6")

So the user will see a shortcut to "G:\" named "My Secret Files", when he clicks on it he will be redirected to "G:\"
- Save the file in the directory of your choice (not a shared directory, user could access the links file) and then, in the user account set the "links file box" the path to the links file.

Finished ! Was it difficult ?

Well for those wanting more and more options, we can give some extra tips :

- When you want a user to have a shortcut to his "Home Directory" create a link with ~ as path. So for our user, he will have 2 links :
My Secret Files   | G:\
To Home Directory | ~
- To have your links listed first, i suggest you to put a "+" (or any high letter listed before "a") as first letter :
+My Secret Files   | G:\
+To Home Directory | ~
So that these links will be at the top of the directory list.

This can also be made for a group, in this case they will all have the same links, for that just set the "links file box" in the group account instead of the user account (don't forget to give group access to the shared directory).

Applications

So if you have understood with what it deals, you can create some virtual directories.

Imagine :
- You run a FTP Site with G6FTP and you specify that clients see relative path instead of full path.
- Your site is accessible through typing : ftp://user:pass@192.168.0.1/ for the root
- You want user to get access to : ftp://user:pass@192.168.0.1/My Lastest Photos/ but this dir does not exists on your server or is located on another drive (not in the user root path).

Solution : Create a link file as we made above.
For example :
My Latest Photos | G:\Path\MyLatestPhotos\
do not forget to share the drive for at least read access to user and now My Latest Photos can be seen by users typing ftp://user:pass@192.168.0.1/My Lastest Photos/Myphotos.jpg (for example) without having to change directory.

Any calls to this directory is redirected to the corresponding path.

Note Concerning links

- Links pointing to invalid directory (not existing) are not shown.
- Links pointing to themselves are not shown (if user is in the directory pointed by the link).
- Links are shown in all user's directories (it may change in the future).

Enhanced links : Virtual Directory

Based on links structure (you do not need to change your linkfile), virtual directory are mounted in home directory.

The difference between link and VD is that client is not redirected but virtual directory simulates the real directroy :
My Latest Photos | G:\Path\Photos\
If admin sets to treat links file as Virtual Directory then client will see a new directory in the dir list :
(D=Directory)
(F=File)

Home Dir = /

(D) Divers
(D) My Latest Photos
(F) index.txt
(F) notes.txt
When he clicks on "My Latest Photos" path becomes "/My Latest Photos" and the content is "G:\Path\MyLatestPhotos\" 's content instead of perhaps "/Path/Photos" if G:\ is shared for user.

You can mount as much VD as you want in home directory.

Note:
- I think this is a more esthetic way to link directory.
- You do still have to share the target path to enable virtual directory.