I had a look for some possible solutions and found that while File-Locking is possible e.g.
LockFileEx is defined as
Code: Select all
BOOL LockFileEx(
HANDLE hFile,
DWORD dwFlags,
DWORD dwReserved,
DWORD nNumberOfBytesToLockLow,
DWORD nNumberOfBytesToLockHigh,
LPOVERLAPPED lpOverlapped
);
another simpler way is for DC++ set the file attribute to read-only (except when writing from the buffer- Natchurly) as it's a simple matter to set-unset RO attribute before and after updating a file, although this isn't as "safe" as file-locking it would be good enough for DC++ purposes IMO and most likely stop me from corrupting more downloads
just a thought