| Home | All functions | Categories |
vuCreateJunction(*CSTRING,*CSTRING), LONG
Creates a junction point that links one directory to another. A junction allows a folder to appear in multiple locations on the file system.
| Parameter | Data Type | Description |
|---|---|---|
| JunctionPath | CSTRING(260) | Full path of the new junction directory to create. |
| TargetDir | CSTRING(260) | Full path of the existing directory that the junction will reference. |
Note: In vuFileTools V5, CSTRINGs are not limited to the size shown above. The number is for example only.
A LONG value indicating the result:
base CSTRING(260)
junctionPath CSTRING(260)
targetDir CSTRING(260)
rc LONG
msg CSTRING(256)
base = 'C:\_Temp\vuFT5\'
junctionPath = base & 'LinkTests_junction'
targetDir = base & 'LinkTests'
rc = vuCreateJunction(junctionPath, targetDir)
CASE rc
OF 1 ; msg = 'Junction created successfully: ' & junctionPath
OF -5 ; msg = 'Access denied while creating junction.'
OF -7 ; msg = 'Target directory not found: ' & targetDir
OF -8 ; msg = 'mklink process failure while creating junction.'
ELSE msg = 'Junction failed. rc=' & FORMAT(rc)
END
MESSAGE(msg, 'vuCreateJunction Test')
Notes
The target directory must already exist.
The parent path of JunctionPath must exist or the call will fail.
Junctions work only with directories and require NTFS file system.
| Home | All functions | Categories |