public static void link ( File source , File target ) throws IOException { if ( UtilJNI . ON_WINDOWS == 1 ) { if ( UtilJNI . CreateHardLinkW ( target . getCanonicalPath ( ) , source . getCanonicalPath ( ) , 0 ) == 0 ) { throw new IOException ( "link failed" ) ; } } else { if ( UtilJNI . link ( source . getCanonicalPath ( ) , target . getCanonicalPath ( ) ) != 0 ) { throw new IOException ( "link failed: " + strerror ( ) ) ; } } }
Creates a hard link from source to target .