Skip to content

Files

Latest commit

 

History

History
75 lines (47 loc) · 2.02 KB

CreateSymbolicLink.md

File metadata and controls

75 lines (47 loc) · 2.02 KB

Home

Function name : CreateSymbolicLink

Group: File Management - Library: kernel32


Creates a symbolic link.


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.


Comments:

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.