Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 23rd November 2014, 13:43   #12  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,160
Quote:
Originally Posted by TheFluff View Post
_fseeki64() and _ftelli64() are what you want but who knows if they're available in your ancient runtime
(looks like they're not, VS2005 or newer I think)
Either that, or just use the _fstati64() function, which avoids having to move the file pointer around. Also you don't need to go down to the Win32 API this way.

It appears to be available in VS 6.0:
http://msdn.microsoft.com/en-us/libr...=vs.60%29.aspx
Code:
#include <sys/stat.h>

__int64 getFileSize64(FILE *const fp)
{
	struct _stati64 stat;
	if(_fstati64(_fileno(fp), &stat) != 0)
	{
		return -1; /*some error occurred*/
	}
	return stat.st_size;
}

Quote:
Originally Posted by StainlessS View Post
I'm not altogether happy about mixing eg file handles and FILE*, but will investigate all things suggested.
On Windows, each FILE* has an associated "native" operating system HANDLE, which you can get via _get_osfhandle(), if you really need to.

It is returned as an intptr_t, but you can typecast to HANDLE safely. I would still prefer the fstat()-based solution, since it's cross-platform.
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 23rd November 2014 at 14:02.
LoRd_MuldeR is offline   Reply With Quote
 

Tags
file system, large file support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.