473,396 Members | 2,109 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,396 software developers and data experts.

support large files

Hi,

I'm having bit of questions on recursive pointer. I have following
code that supports upto 8K files but when i do a file like 12K i get a
segment fault. I Know it is in this line of code. How do i make the
last pointer in the indirect sector that has another level of indirect
pointer, and be defined recursively to support infinite large files?

-code-

bool
FileHeader::Allocate(BitMap *freeMap, int fileSize)
{
int i;

numBytes = fileSize;
numSectors = divRoundUp(fileSize, SectorSize);
if (freeMap->NumClear() < (numSectors+1))
return FALSE; // not enough space

int directSectors = numSectors % NumDirect;

for (i = 0; i < directSectors; i++)
dataSectors[i] = freeMap->Find();

if( (numSectors / NumDirect) > 0 ) {
indirectHdrSector = freeMap->Find();
FileHeader *hdr = new FileHeader;
for( i = 0; i < (numSectors - directSectors); i++ )
hdr->dataSectors[i] = freeMap->Find();
hdr->WriteBack(indirectHdrSector);
delete hdr;
}
return TRUE;
}
Nov 14 '05 #1
1 1337

"Joseph" <cr*******@gmail.com> wrote in message
news:co**********@usenet01.srv.cis.pitt.edu...
Hi,
Hi.

<snip> bool
FileHeader::Allocate(BitMap *freeMap, int fileSize)

<snip>

The '::' indicates you are using C++. I think you will get a better aswer in
comp.lang.c++. It's definately off-topic here.

Sorry.
Nov 14 '05 #2

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

Similar topics

2
by: Eddie Parker | last post by:
Hello! Standard disclaimer here - I'm new, so I'm not sure if this is the wrong place to be posting, so please be kind if I am, and I'll kindly move my question elsewhere. :) Otherwise - thank...
0
by: pruebauno | last post by:
Hello all, I am having issues compiling Python with large file support. I tried forcing the configure script to add it but then it bombs in the make process. Any help will be appreciated. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
16
by: Claudio Grondi | last post by:
What started as a simple test if it is better to load uncompressed data directly from the harddisk or load compressed data and uncompress it (Windows XP SP 2, Pentium4 3.0 GHz system with 3 GByte...
0
by: dtsearch | last post by:
New release expands-through a .NET Spider API, to Linux, and to OpenOffice-dtSearch's ability to index over a terabyte of text in a single index, with indexed search time typically less than a...
0
by: dtsearch | last post by:
A new beta build offers 64-bit developer access to dtSearch's "terabyte indexer," and preliminary MS Word 2007 and Excel 2007 support (in both 64-bit and 32-bit versions) BETHESDA, MD (July 22,...
1
by: shyam | last post by:
Hi All I have a application which is basically a log manager and accepts log messages from other processes and logs them in files ( one file per process per day ). The application manages the...
2
by: robert | last post by:
Somebody who uses my app gets a error : os.stat('/path/filename') OSError: Value too large for defined data type: '/path/filename' on a big file >4GB ( Python 2.4.4 / Linux )
4
by: Nagrik | last post by:
Hello Group, I have to support 200 Gigabyte support to open a file in my program. My program exits with open("/mnt/d1/tmp/<file name>", O_RDONLY) = -1 EFBIG (File too large) This open...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.