2 #include "PortableTruncate.h"
5 int PortableTruncate_justHereToAvoidRanlibWarning(void) { return 0; }
14 // Win32 truncate by Mike Austin
16 int truncate(const char *path
, long length
)
18 HANDLE file
= CreateFile(path
, GENERIC_WRITE
, 0, NULL
, OPEN_EXISTING
,
19 FILE_SHARE_WRITE
| FILE_SHARE_READ
, NULL
);
21 if (file
== INVALID_HANDLE_VALUE
)
26 if (SetFilePointer(file
, length
, NULL
, FILE_BEGIN
) == 0xFFFFFFFF || !SetEndOfFile(file
))
38 #if defined(__SYMBIAN32__)
39 int truncate(const char* path
, long length
)
41 // TODO: Implement for Symbian