Back to the WFC main page
wfc_create_hard_link
$Revision: 3 $
Declaration
BOOL wfc_create_hard_link( LPCTSTR new_filename, LPCTSTR existing_filename, LPSECURITY_ATTRIBUTES sa )
Description
This function creates two directory entries for one file.
NT 5.0 will have an API called
CreateHardLink()
that does the same thing.
Example
#include <wfc.h>
int _tmain( int number_of_command_line_arguments, LPCTSTR command_line_arguments[] )
{
WFCTRACEINIT( TEXT( "_tmain()" ) );
if ( number_of_command_line_arguments < 2 )
{
_tprintf( TEXT( "Usage: ln new_filename existing_filename\n" ) );
return( EXIT_SUCCESS );
}
if ( wfc_create_hard_link( command_line_arguments[ 1 ],
command_line_arguments[ 2 ],
NULL ) == FALSE )
{
_tprintf( TEXT( "Failed.\n" ) );
return( EXIT_FAILURE );
}
return( EXIT_SUCCESS );
}
API's Used
wfc_create_hard_link() uses the following API's:
- BackupWrite
- CreateFile
- GetFullPathNameW
- ZeroMemory
Copyright, 2000, Samuel R. Blackburn
$Workfile: wfc_create_hard_link.cpp $
$Modtime: 1/17/00 9:32a $