> Salem, your code does not compile, the IDE(Code::Blocks) keeps saying that LARGE_INTEGER is an unknown type and so is HANDLE and that #ifdef is unterminated.
Yeah, that's my fault.
A severe...
Type: Posts; User: Salem
> Salem, your code does not compile, the IDE(Code::Blocks) keeps saying that LARGE_INTEGER is an unknown type and so is HANDLE and that #ifdef is unterminated.
Yeah, that's my fault.
A severe...
This was more or less OK (as a valid C program)
FILE *f = fopen("g:\\Mess.m2ts", "rb");
if (f)
fseek(f, 0ull, SEEK_END);
size = ftell(f);
fclose(f);
printf ("size is : %ull",...
> Your code doesn't compile. I just need a working example so that I can understand what is going on with it
You'll learn more by making what I've posted work.
> substitute vars and play around...
I suggest you learn as much standard C as possible on a single platform before worrying about the intricacies of getting portable code to work across a range of platforms.
When writing portable code, you should look to create your own wrapper functions around the variable functionality.
Eg.
#ifdef WIN32
// Windows
long long myGetFileSize ( const char *filename...
> I am using Code::Blocks GCC under Windows 7 64bit
Code::blocks (via MinGW) uses the Microsoft runtime library, which means you have all the bugs and incompatibilities thereof.
Size...
> long ftell(FILE *stream);
Your file is larger than a long.
Use fgetpos() instead, as it should be able to deal with any size your file system supports.
However, I notice the use of...