 |
CreateSymbolicLink ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Creates a symbolic link. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOLEAN WINAPI CreateSymbolicLink(
__in LPTSTR lpSymlinkFileName,
__in LPTSTR lpTargetFileName,
__in DWORD dwFlags
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER CreateSymbolicLink IN kernel32;
STRING lpSymlinkFileName,;
STRING lpTargetFileName,;
LONG dwFlags
|
 |
 |
 |
| Parameters: |
 |
lpSymlinkFileName [in]
The symbolic link to be created.
lpTargetFileName [in]
The name of the target for the symbolic link to be created.
dwFlags [in]
Indicates whether the link target, lpTargetFileName, is a directory (1).
|
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is nonzero. |
 |
 |
| Usage: |
 |
* creating symbolic link to directory
IF CreateSymbolicLink("c:\temp\mydir_lnk",;
"c:\temp\mydir", 1) = 0
* 183=ERROR_ALREADY_EXISTS
* 1314=ERROR_PRIVILEGE_NOT_HELD
? GetLastError()
ENDIF
|
 |
 |
| My comment: |
 |
Minimal OS: Vista.
Symbolic link (symlink, softlink) is very similar to Windows shortcut. It contains information about the destination of the target file.
Hard link is a reference stored in directory structure referring to the target file.
* * *
If this function fails, you may try to call it starting the VFP in admin mode. Only users with the Create Symbolic Link privilege, which administrators have by default, can create symbolic links.
When creating s symbolic link the system does not check whether the source file exists.
Deleting a symbolic link does not affect the source file. There are no specific function for doing that. Use regular API functions for deleting files.
Windows Vista supports symbolic (and hard) links for both files and directories with the command line utility mklink.
The junction points in Windows are known starting with Windows 2000.
Symbolic link on Wikipedia
See also: CreateHardLink |
 |
 |
| Word Index links for the CreateSymbolicLink : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2008-12-04 16:26:23 | | Modified: | 2010-05-25 11:15:07 | Visited in last 7 days: 15 |