473,399 Members | 4,192 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,399 software developers and data experts.

Logging Data to Files

I have a project that requires logging of data to a file. The file is
supposed to hold records until it reaches a certain size, then start
shifting the oldest records out as the new data is being written to the
file.

Anyone know where to find sample code to accomplish this?
Thanks

Nov 21 '05 #1
4 1411
Tim,

You need for that the FileInfo class property length to do that.

http://msdn.microsoft.com/library/de...engthtopic.asp

With all the rest of the references about filehandling on this page it
should in my opinion be for every programmer (beginner or not) a piece of
cake to make a program what does what you want.

Cor

"Tim Smith" <cu**********@yahoo.com>
I have a project that requires logging of data to a file. The file is
supposed to hold records until it reaches a certain size, then start
shifting the oldest records out as the new data is being written to the
file.

Anyone know where to find sample code to accomplish this?
Thanks

Nov 21 '05 #2
Tim,

You need for that the FileInfo class property length to do that.

http://msdn.microsoft.com/library/de...engthtopic.asp

With all the rest of the references about filehandling on this page it
should in my opinion be for every programmer (beginner or not) a piece of
cake to make a program what does what you want.

Cor

"Tim Smith" <cu**********@yahoo.com>
I have a project that requires logging of data to a file. The file is
supposed to hold records until it reaches a certain size, then start
shifting the oldest records out as the new data is being written to the
file.

Anyone know where to find sample code to accomplish this?
Thanks

Nov 21 '05 #3
"Tim Smith" <cu**********@yahoo.com> schrieb:
I have a project that requires logging of data to a file. The file is
supposed to hold records until it reaches a certain size, then start
shifting the oldest records out as the new data is being written to the
file.


Take a look at 'FileOpen', 'FileGet', 'FilePut', and 'FileClose' in the
documentation.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #4
"Tim Smith" <cu**********@yahoo.com> schrieb:
I have a project that requires logging of data to a file. The file is
supposed to hold records until it reaches a certain size, then start
shifting the oldest records out as the new data is being written to the
file.


Take a look at 'FileOpen', 'FileGet', 'FilePut', and 'FileClose' in the
documentation.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #5

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

Similar topics

0
by: Pete Jereb | last post by:
Ok, I've managed to get the logging package to work, sort of. I'm writing a text parser, where data entry clerks can edit large, unwieldy and unforgiving textfiles that are VERY SENSITIVE as to...
0
by: Neil Benn | last post by:
Hello, I'm running a test and having issues with logging, if I call logging.shutdown() and then want to start the logging going again then I get a problem as if I call shutdown, I can't get the...
2
by: Tor Erik Sønvisen | last post by:
Hi Have the following code: import logging logging.basicConfig(level = logging.DEBUG, format = ' %(message)s', filename = 'rfs.log', filemode = 'w')
4
by: Paul Woods | last post by:
I'm developing an application that uses a custom 404 page to deliver all of my site's content. However, doing things this way renders IIS's regular log files pretty much useless. Are there any...
6
by: Burkhard Schultheis | last post by:
As I wrote last week, we have a problem with a DB2 V8 on Linux. Here is what is in db2diag.log during online backup: Starting a full database backup. 2004-04-01-02.33.54.760164 ...
2
by: johnm | last post by:
As a refresher, a description of my problem is in the message body below. I could not get answers to all of the questions that were asked below in a previous thread, but here is what I found out:...
3
by: Karuppasamy | last post by:
Hi I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net . I installed everything as per the Instructions given in the 'Development Using the Logging Block'. ...
3
by: Udi | last post by:
Hi All, I'm developping an application that has a very strong logging requirement - we should be able to log up to 5000 messages per second, most of them are reletively small -(16 - 30 Words)...
3
by: Dick | last post by:
How do I integrating ASP.NET Tracing with the Enterprise Library Logging Application Block? I guess this should be possible and in a similar way to the way ASP.NET Tracing is integrated with...
3
by: Chris Shenton | last post by:
I am setting up handlers to log DEBUG and above to a rotating file and ERROR and above to console. But if any of my code calls a logger (e.g., logging.error("foo")) before I setup my handlers, the...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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.