Click here to Skip to main content
15,914,322 members
Home / Discussions / C#
   

C#

 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
rich_wenger6-Jan-09 8:08
rich_wenger6-Jan-09 8:08 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
#realJSOP6-Jan-09 8:21
professional#realJSOP6-Jan-09 8:21 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
rich_wenger6-Jan-09 8:40
rich_wenger6-Jan-09 8:40 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
Dave Kreskowiak6-Jan-09 9:24
mveDave Kreskowiak6-Jan-09 9:24 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
#realJSOP6-Jan-09 9:29
professional#realJSOP6-Jan-09 9:29 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
rich_wenger6-Jan-09 11:19
rich_wenger6-Jan-09 11:19 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
#realJSOP6-Jan-09 23:10
professional#realJSOP6-Jan-09 23:10 
AnswerRe: Filtering FileSystemWatcher Events By File Size Pin
Dave Kreskowiak6-Jan-09 7:53
mveDave Kreskowiak6-Jan-09 7:53 
rich_wenger wrote:
FileInfo fi = new FileInfo(e.FullPath);
if (fi.Length > 524288000)// 500MB = 524288000


This isn't going to work. When a file is created, it's length is always 0. Only when the application flushes it's writes to the file does the filesize increase, for which there is NO FSW event.

Your code has to keep track of the files that are new, then occasionally check back with those files to get their current sizes, then you can do what's necessary.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
rich_wenger6-Jan-09 8:10
rich_wenger6-Jan-09 8:10 
GeneralRe: Filtering FileSystemWatcher Events By File Size Pin
Dave Kreskowiak6-Jan-09 9:19
mveDave Kreskowiak6-Jan-09 9:19 
QuestionRegEx Pin
Abdul Rahman Hamidy6-Jan-09 3:51
Abdul Rahman Hamidy6-Jan-09 3:51 
AnswerRe: RegEx Pin
Simon P Stevens6-Jan-09 3:58
Simon P Stevens6-Jan-09 3:58 
AnswerRe: RegEx Pin
Wendelius6-Jan-09 3:58
mentorWendelius6-Jan-09 3:58 
AnswerRe: RegEx Pin
Paddy Boyd6-Jan-09 4:09
Paddy Boyd6-Jan-09 4:09 
AnswerRe: RegEx Pin
MarcelloTurnbull6-Jan-09 7:25
MarcelloTurnbull6-Jan-09 7:25 
Questioncalling a matlab function from c# Pin
yrajwan6-Jan-09 2:54
yrajwan6-Jan-09 2:54 
AnswerRe: calling a matlab function from c# Pin
EliottA6-Jan-09 3:18
EliottA6-Jan-09 3:18 
GeneralRe: calling a matlab function from c# Pin
yrajwan6-Jan-09 3:26
yrajwan6-Jan-09 3:26 
GeneralRe: calling a matlab function from c# [modified] Pin
EliottA6-Jan-09 3:28
EliottA6-Jan-09 3:28 
GeneralOT- Welcome in the CP's memorable quotes Pin
CPallini6-Jan-09 6:16
mveCPallini6-Jan-09 6:16 
GeneralRe: OT- Welcome in the CP's memorable quotes Pin
EliottA6-Jan-09 6:23
EliottA6-Jan-09 6:23 
QuestionDataSet Problem ! Pin
Mohammad Dayyan6-Jan-09 2:39
Mohammad Dayyan6-Jan-09 2:39 
AnswerRe: DataSet Problem ! Pin
Wendelius6-Jan-09 2:47
mentorWendelius6-Jan-09 2:47 
AnswerRe: DataSet Problem ! Pin
Jason C Bourne7-Jan-09 11:21
Jason C Bourne7-Jan-09 11:21 
GeneralRe: DataSet Problem ! Pin
Mohammad Dayyan7-Jan-09 23:27
Mohammad Dayyan7-Jan-09 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.