473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

tellg() for large filesizes

Hi all,

I'm trying to retrieve the filesize of a file which size is larger then
4G. Old C functions are insufficient for they return a long. The
standard c++ methods tellg() and seekg() also doesn't seem to work for
these sizes.
Do you know how I can resolve these kind of problems?

regards, Philippe.

Sep 5 '05 #1
2 3561
ph*************@intec.ugent.be wrote:
Hi all,

I'm trying to retrieve the filesize of a file which size is larger then
4G. Old C functions are insufficient for they return a long. The
standard c++ methods tellg() and seekg() also doesn't seem to work for
these sizes.
Do you know how I can resolve these kind of problems?
Use operating system dependant filesystem functions.

regards, Philippe.

Sep 5 '05 #2
Hi,

Usually for 64 bit systems (I assume you are on one of those) there is
something like fstat for 64 bit. With that you should be able to get the
right file size.

--
Regards, Ron AF Greve

http://moonlit.xs4all.nl

<ph*************@intec.ugent.be> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi all,

I'm trying to retrieve the filesize of a file which size is larger then
4G. Old C functions are insufficient for they return a long. The
standard c++ methods tellg() and seekg() also doesn't seem to work for
these sizes.
Do you know how I can resolve these kind of problems?

regards, Philippe.

Sep 6 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jonathan | last post by:
Hi, I installed a Apache 2.0.47, PHP 4.3.2 and MySQL 3.23.38 on windows2000 and I installed a forum on which I enabled the feature to upload files. Together with some friends of mine I make music...
2
by: Fred Ma | last post by:
I'm using the stringstreams to get the numerical values of string tokens (the strings result from tokenizing a line of input elsewhere): #include <iostream> #include <sstream> using namespace...
6
by: Eivind Grimsby Haarr | last post by:
I know that this has been posted before on several other newsgroups, but I need to make sure I got this right, so I hope you can forgive me for posting this. In MVSC6.0, and also in several...
16
by: kate | last post by:
salve. per favore rispondete alla mia domanda: Come faccio a ottenere le dimensioni di un file?(con c/c++) risp presto grazie
9
by: wizofaus | last post by:
Is the any reason according to the standard that calling tellg() on an std::ifstream after a call to peek() could place the filebuf in an inconsistent state? I think it's a bug in the VC7...
0
by: Chris | last post by:
I am reading in image files in a program and I read in the header in ascii mode. The problem is, sometimes tellg () gives me a completely incorrect result and sometimes it is just fine. Here is...
1
by: Chris | last post by:
I am reading in image files in a program and I read in the header in ascii mode and the data in binary mode. The problem is, sometimes tellg() gives me a completely incorrect result and sometimes...
1
by: Jacek Dziedzic | last post by:
Hello! This is my first time dealing with Very Large Files. I have vector of strings representing numbers and I need to extract bytes in binary mode from a Large File that correspond to...
12
by: toton | last post by:
Hi, I am reading a big file , and need to have a flag for current file position so that I can store the positions for later direct access. However it looks tellg is a very costly function ! But...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.