105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
#endif
#if !defined(HAVE_READDIR_R) && defined(OF_HAVE_THREADS) && !defined(OF_WINDOWS)
static OFMutex *readdirMutex;
#endif
#ifdef OF_WINDOWS
static WINAPI BOOLEAN (*func_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD);
#endif
#ifdef OF_WINDOWS
static of_time_interval_t
filetimeToTimeInterval(const FILETIME *filetime)
{
return (double)((int64_t)filetime->dwHighDateTime << 32 |
|
>
>
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
#endif
#if !defined(HAVE_READDIR_R) && defined(OF_HAVE_THREADS) && !defined(OF_WINDOWS)
static OFMutex *readdirMutex;
#endif
#ifdef OF_WINDOWS
static WINAPI BOOLEAN (*func_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD);
static WINAPI BOOLEAN (*func_CreateHardLinkW)(LPCWSTR, LPCWSTR,
LPSECURITY_ATTRIBUTES);
#endif
#ifdef OF_WINDOWS
static of_time_interval_t
filetimeToTimeInterval(const FILETIME *filetime)
{
return (double)((int64_t)filetime->dwHighDateTime << 32 |
|
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
|
passwdMutex = [[OFMutex alloc] init];
#endif
#if !defined(HAVE_READDIR_R) && !defined(OF_WINDOWS) && defined(OF_HAVE_THREADS)
readdirMutex = [[OFMutex alloc] init];
#endif
#ifdef OF_WINDOWS
if ((module = LoadLibrary("kernel32.dll")) != NULL)
func_CreateSymbolicLinkW =
(WINAPI BOOLEAN (*)(LPCWSTR, LPCWSTR, DWORD))
GetProcAddress(module, "CreateSymbolicLinkW");
#endif
/*
* Make sure OFFile is initialized.
* On some systems, this is needed to initialize the file system driver.
*/
[OFFile class];
|
|
>
>
>
>
>
|
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
|
passwdMutex = [[OFMutex alloc] init];
#endif
#if !defined(HAVE_READDIR_R) && !defined(OF_WINDOWS) && defined(OF_HAVE_THREADS)
readdirMutex = [[OFMutex alloc] init];
#endif
#ifdef OF_WINDOWS
if ((module = LoadLibrary("kernel32.dll")) != NULL) {
func_CreateSymbolicLinkW =
(WINAPI BOOLEAN (*)(LPCWSTR, LPCWSTR, DWORD))
GetProcAddress(module, "CreateSymbolicLinkW");
func_CreateHardLinkW =
(WINAPI BOOLEAN (*)(LPCWSTR, LPCWSTR,
LPSECURITY_ATTRIBUTES))
GetProcAddress(module, "CreateHardLinkW");
}
#endif
/*
* Make sure OFFile is initialized.
* On some systems, this is needed to initialize the file system driver.
*/
[OFFile class];
|
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
|
if (link([sourcePath cStringWithEncoding: encoding],
[destinationPath cStringWithEncoding: encoding]) != 0)
@throw [OFLinkFailedException
exceptionWithSourceURL: source
destinationURL: destination
errNo: errno];
# else
if (!CreateHardLinkW(destinationPath.UTF16String,
sourcePath.UTF16String, NULL))
@throw [OFLinkFailedException
exceptionWithSourceURL: source
destinationURL: destination
errNo: 0];
# endif
|
>
>
>
>
|
|
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
|
if (link([sourcePath cStringWithEncoding: encoding],
[destinationPath cStringWithEncoding: encoding]) != 0)
@throw [OFLinkFailedException
exceptionWithSourceURL: source
destinationURL: destination
errNo: errno];
# else
if (func_CreateHardLinkW == NULL)
@throw [OFNotImplementedException exceptionWithSelector: _cmd
object: self];
if (!func_CreateHardLinkW(destinationPath.UTF16String,
sourcePath.UTF16String, NULL))
@throw [OFLinkFailedException
exceptionWithSourceURL: source
destinationURL: destination
errNo: 0];
# endif
|