Symlink()
ts
Symlink(path: string, linkFile: string): respBase;Creates a symbolic link within the target file-system. The function takes two paths as input: the target path (a file or directory within the VFS) and the link path (which must also be within the scope of the VFS).
The function creates a special file at the link path that acts as a reference or pointer to the target path.
Parameters
| Parameter | Type | Explanation |
|---|---|---|
path | string | The fully qualified root-based target path to the file/directory you wish to link to |
linkFile | string | The fully qualified root-based path to the symbolic link file to be created |
Returns a respBase object.
Example
ts
var vfs = GetCurrentVFS();
if (vfs != null) {
var resp = vfs.Symlink("/data/lastbackup.zip", "/links/bak.zip");
if (resp.Ok()) {
Log("Symbolic link created");
} else {
Log("Error: " + resp.ErrorMsg());
}
} else {
Log("VFS was null");
}