Using Win32 functions in Visual FoxPro Image Gallery
File Management
..msdn
CopyFile
CopyFileTransacted
CreateDirectory
CreateFile
CreateFileTransacted
CreateHardLink
CreateSymbolicLink
DeleteFile
DeleteFileTransacted
FindClose
FindCloseChangeNotification
FindFirstChangeNotification
FindFirstFile
FindNextChangeNotification
FindNextFile
FlushFileBuffers
GetBinaryType
GetCurrentDirectory
GetDriveType
GetFileAttributes
GetFileAttributesEx
GetFileInformationByHandle
GetFileType
GetFullPathName
GetLongPathName
GetShortPathName
GetTempFileName
GetTempPath
LockFile
MoveFile
MoveFileTransacted
OpenFile
QueryDosDevice
ReadDirectoryChangesW
ReadFile
RemoveDirectory
RemoveDirectoryTransacted
ReplaceFile
SearchPath
SetCurrentDirectory
SetEndOfFile
SetFileAttributes
SetFilePointer
SetFilePointerEx
SetSearchPathMode
UnlockFile
WriteFile
_lclose
_lopen
Code examples:
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2008-12-04 16:26:23
Modified: 2010-05-25 11:15:07
Visited in last 7 days: 13
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.162.166.214)
10 sec.Function: 'CeRegSetValueEx'
21 sec.Function: 'DetachVirtualDisk'
Function group: 'Virtual Hard Disk (Win7)'
42 sec.Function: 'CreateDirectory'
Function group: 'File Management'
53 sec.
Function group: 'GDI+ Image'
1.03 min.Function: 'CeGetSystemInfo'
Function group: 'Remote Application Programming (RAPI)'
1.15 min.Function: 'FlushFileBuffers'
1.3 min.
Function group: 'File Management'
1.45 min.Function: 'MoveFile'
Function group: 'File Management'
1.65 min.Function: 'CeRegCloseKey'
1.87 min.Function: 'DeviceCapabilities'
Google
Advertise here!