What can i do to open , write and seek in file with size 2 GB or more
I know that you r limited with int type size which is 32-bit but how
programs like gzip , zip read and write from files with big size like
2-GB
how can i break this limit in C or even C++ 8 8150
On Dec 31 2007, 11:59*pm, "åäÏÇæì" <3D.v.Wo...@gma il.comwrote:
What can i do to open , write and seek in file with size 2 GB or more
I know that you r limited with int type size which is 32-bit but how
programs like gzip , zip read and write from files with big size like
2-GB
*how can i break this limit in C or even C++
In Win32, you can use LARGE_INTEGER structure, and the APIs support 64-
bit integers.
Many compilers have built-in support for 64-bit integers, such as
__int64 in Microsoft C++ compiler.
However, it seems that standard C functions do not support 64-bit
integers.
Some compilers provide big file support
Microsoft and other compilers like lcc-win provide special functions
like fseeki64 and other functions to cope with files bigger than
2GB under the windows system.
what about more than 2GB , windows or linux as example can deal with
more than 2GB and it's written in C++
how can they do that
هنداوى wrote:
>Some compilers provide big file support Microsoft and other compilers like lcc-win provide special functions like fseeki64 and other functions to cope with files bigger than 2GB under the windows system.
what about more than 2GB , windows or linux as example can deal with
more than 2GB and it's written in C++
how can they do that
bigger than 2GB means BIGGER (greater than). This means a file of
1000 GB if you wish!
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique http://www.cs.virginia.edu/~lcc-win32
bigger than 2GB means BIGGER (greater than). This means a file of
1000 GB if you wish!
Is there is any method available in C/C++ or any language to deal with
that
Python for example manage variables types in this case is the size
will be infinite"limite d to physical memory size" or also limited to
64-bit
åäÏÇæì wrote:
What can i do to open , write and seek in file with size 2 GB or more
I know that you r limited with int type size which is 32-bit but how
programs like gzip , zip read and write from files with big size like
2-GB
how can i break this limit in C or even C++
The size of an int isn't relevant; the relevant functions are fseek()
and ftell(), and they use long, not int.
'long' is only guaranteed to be at least 32 bits; it can be larger
than that, and on many systems it is. On systems where 'long' is a 64-
bit type, there is no problem (for now - wait a few decades and even
64 bits might not be enough).
I'm not very familiar with systems where files can be greater than
2GB, but long is too small to hold a file length, so I'll let others
tell you what to do in that case. However, in principle even when
'long' is only 32 bits, you could handle files longer than 2GB by
using fgetpos() and fsetpos() instead of fseek() and ftell(). The
interface is clumsier, but it's still workable. However, I know that
on at least some systems, the ability to work in that fashion to
handle files larger than 2GB is deliberately disabled; you have to use
special functions that are not defined by the C standard to access the
part of a long file that is after an offset of LONG_MAX.
On Dec 31, 9:48*am, jameskuy...@ver izon.net wrote:
åäÏÇæì wrote:
What can i do to open , write and seek in file with size 2 GB or more
I know that you r limited with int type size which is 32-bit but how
programs like gzip , zip read and write from files with big size like
2-GB
*how can i break this limit in C or even C++
The size of an int isn't relevant; the relevant functions are fseek()
and ftell(), and they use long, not int.
'long' is only guaranteed to be at least 32 bits; it can be larger
than that, and on many systems it is. On systems where 'long' is a 64-
bit type, there is no problem (for now - wait a few decades and even
64 bits might not be enough).
I'm not very familiar with systems where files can be greater than
2GB, but long is too small to hold a file length, so I'll let others
tell you what to do in that case. However, in principle even when
'long' is only 32 bits, you could handle files longer than 2GB by
using fgetpos() and fsetpos() instead of fseek() and ftell(). The
interface is clumsier, but it's still workable. However, I know that
on at least some systems, the ability to work in that fashion to
handle files larger than 2GB is deliberately disabled; you have to use
special functions that are not defined by the C standard to access the
part of a long file that is after an offset of LONG_MAX.
Hence, the FAQ:
12.25: What's the difference between fgetpos/fsetpos and ftell/fseek?
What are fgetpos() and fsetpos() good for?
A: ftell() and fseek() use type long int to represent offsets
(positions) in a file, and may therefore be limited to offsets
of about 2 billion (2**31-1). The newer fgetpos() and
fsetpos()
functions, on the other hand, use a special typedef, fpos_t,
to
represent the offsets. The type behind this typedef, if
chosen
appropriately, can represent arbitrarily large offsets, so
fgetpos() and fsetpos() can be used with arbitrarily huge
files.
fgetpos() and fsetpos() also record the state associated with
multibyte streams. See also question 1.4.
References: K&R2 Sec. B1.6 p. 248; ISO Sec. 7.9.1,
Secs. 7.9.9.1,7.9.9.3 ; H&S Sec. 15.5 p. 252.
On Dec 31, 11:16*am, user923005 <dcor...@connx. comwrote:
On Dec 31, 9:48*am, jameskuy...@ver izon.net wrote:
åäÏÇæì wrote:
What can i do to open , write and seek in file with size 2 GB or more
I know that you r limited with int type size which is 32-bit but how
programs like gzip , zip read and write from files with big size like
2-GB
*how can i break this limit in C or even C++
The size of an int isn't relevant; the relevant functions are fseek()
and ftell(), and they use long, not int.
'long' is only guaranteed to be at least 32 bits; it can be larger
than that, and on many systems it is. On systems where 'long' is a 64-
bit type, there is no problem (for now - wait a few decades and even
64 bits might not be enough).
I'm not very familiar with systems where files can be greater than
2GB, but long is too small to hold a file length, so I'll let others
tell you what to do in that case. However, in principle even when
'long' is only 32 bits, you could handle files longer than 2GB by
using fgetpos() and fsetpos() instead of fseek() and ftell(). The
interface is clumsier, but it's still workable. However, I know that
on at least some systems, the ability to work in that fashion to
handle files larger than 2GB is deliberately disabled; you have to use
special functions that are not defined by the C standard to access the
part of a long file that is after an offset of LONG_MAX.
thank's alot
that really the info(s) what i want
On Dec 31 2007, 6:17 pm, "åäÏÇæì" <3D.v.Wo...@gma il.comwrote:
Some compilers provide big file support
Microsoft and other compilers like lcc-win provide special functions
like fseeki64 and other functions to cope with files bigger than
2GB under the windows system.
what about more than 2GB , windows or linux as example can deal with
more than 2GB and it's written in C++
how can they do that
There is also open() and O_LARGEFILE as defined by POSIX.
Also, there might be some library to deal with large files. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Min |
last post by:
I have seen so many pointing out "main" should explicitly return "int".
Beside, the language spec or committee, or some guru said so, what is a BIG
deal with it ? What difference does it make if "void main" rather than "int
main" ? It is not that some obscure code that people can't understand
easily. Anyway, would someone explain why ;? not just it is better to
return explicitly.
Or How is it possibly cause the problem ?
PS: I am...
|
by: Franco Gustavo |
last post by:
Hi,
Please help me to understand this, because I don't see what I'm missing.
I was reading a lot of examples on Internet that explain that C# doesn't
implement multiple inheritance it implement multiple interfaces.
|
by: rbt |
last post by:
The house almost always wins or are my assumptions wrong...
import random
amounts =
results =
count = 0
while count < 10:
|
by: Viken Karaguesian |
last post by:
Hello all,
On occasion I want to open hyperlinks (images, etc.) in a new window. In the
past, I've used target="_blank" to open the link in a new window. However,
using the "target" attribute causes my pages to fail validation (strict
doctype). The validator says "There is no attribute 'target'.."
So...how do I open a link in a new window, without Javscript, and pass
strict validation?
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |