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

Rewrite just where it has changed

Hi

I have a very big .txt file, about 17MB, and my application need to read it and make changes at any time

I can put it in a variable and my program writes the file again oly in the end of the program, them it won't nedd to rewrite the file everytime it makes a change. But it uses many space in the memory, and could slow down the system

I was thinks about a way just to write the fiel where is has changed, them it won't write all the file again, so it will be much faster..

If someone has any ideas it could be very helpfull

Thanks in advance.
Nov 20 '05 #1
1 972
Opening a file, seeking, writing, and closing a file every time there is
a change has the potential of being much more inneficient than writing to
memory.

If you were talking about gigabytes, then you might need to come up with
something as you described, with some kind of advanced paging, indexing, and
fast seeking. Pretty complicated stuff. But for just a few megs, you are
going to see your best results by following the archetype:

1) Load file into memory
2) Use memory as your working set
3) Flush memory back to file

Erik

"ltt19" <an*******@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
Hi,

I have a very big .txt file, about 17MB, and my application need to read it and make changes at any time.
I can put it in a variable and my program writes the file again oly in the end of the program, them it won't nedd to rewrite the file everytime it
makes a change. But it uses many space in the memory, and could slow down
the system.
I was thinks about a way just to write the fiel where is has changed, them it won't write all the file again, so it will be much faster...
If someone has any ideas it could be very helpfull.

Thanks in advance.

Nov 20 '05 #2

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

Similar topics

188
by: christopher diggins | last post by:
I have posted a C# critique at http://www.heron-language.com/c-sharp-critique.html. To summarize I bring up the following issues : - unsafe code - attributes - garbage collection -...
14
by: Stan Canepa | last post by:
This post is mostly for discussion. Why rewrite in .NET? Just a general discussion not related to any specific details. I was just looking to see what reasons developers are looking to, to help...
10
by: not_a_commie | last post by:
I've seen studies before showing that it is better to rewrite code when more than 25% (or whatever) of the code needs to be changed. I can't seem to locate any references for that at the moment. Do...
4
by: Harsh Trivedi | last post by:
Hi, We have implemented URL rewriting in our site. It all went OK till home page links. When we click on home page category control, where we have implemented rewriting, it works ok, and open...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
agi2029
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,...
0
isladogs
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...

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.