473,396 Members | 1,683 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.

Monitor the increase of file size

Two processes query a disk file's file size, concurrently and frequently (in
a loop), using the following lines:

FileInfo objFileSize = new FileInfo(fileToCheck);
outputFileSize = objFileSize.Length;

Only one of them writes to the file. And the file size is keeping increasing
all the time.

However, a stange behavior led us to suspect that though the file size is
increasing, one of the process monitoring its changes doesn't catching it
sometimes?

Any idea?

Thanks!
Jun 25 '07 #1
1 1822
I can't say for sure but have you tried the System.IO.FileSystemWatcher
class to get change events instead of polling the size? I've not had any
problems doing it this way.

Jayme

"dh" <dh@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.com...
Two processes query a disk file's file size, concurrently and frequently
(in
a loop), using the following lines:

FileInfo objFileSize = new FileInfo(fileToCheck);
outputFileSize = objFileSize.Length;

Only one of them writes to the file. And the file size is keeping
increasing
all the time.

However, a stange behavior led us to suspect that though the file size is
increasing, one of the process monitoring its changes doesn't catching it
sometimes?

Any idea?

Thanks!
Jun 25 '07 #2

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

Similar topics

2
by: Peter CCH | last post by:
I encounter one weird problem, I have a database with around 7 GB ... when I delete a bunch of data from it, it suppose to reduce the database file size, but weirdly, the file size increase to 8...
4
by: Valerie Hough | last post by:
Does anyone have an example of how to get the PHYSICAL monitor size in C#? In C++ I used to use GetDeviceCaps( dc, HORZSIZE ) which returns the monitor size in mm, then I converted it to inches....
10
by: RobinS | last post by:
Hello to all, and happy new year! I have this application that someone wrote that I'm sort of checking out. The forms look fine in design mode, but when I run the application, it crops off the...
5
by: John | last post by:
Hi I have a typical front end/back end access app. Additionally a vb.net app accesses the backend mdb file every few minutes and runs insert and update queries on some table. The data to be...
4
by: onedbguru | last post by:
DB2Connect Informational tokens are "DB2 v8.1.0.96", "s050811", "U803921", FixPak "10". I am getting txxxxxx.0000 files approximately every 14 minutes that look like: <Trap> <Header> DB2...
4
by: =?Utf-8?B?R2F1cmF2?= | last post by:
Hello... I posted this a couple of weeks back, but could't get a reply, so trying again! I use the Setup project in C# to create a .msi file to be distributed to the clients. The size of...
5
by: Polaris | last post by:
Hi Experts: Using C#, is there a way to get the display monitor's size in inches (for example, I'd like to know if the monitor size is 15", 17" or whatever)? Thanks in Advance Polaris
10
by: Devang | last post by:
Hello, I am using php script to upload file. some times if file size is too big(1GB) it takes too much time to upload. Can someone suggest me the way to increase upload speed. thanks
1
by: nagmvs | last post by:
Hello I am unable to upload More than 200kb in to my server and also i can downlaod only less than 4MB file from my server .When i am searching in internet i found solution as u can...
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.