.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 27th, 2004, 08:59 PM
lanzdale lanzdale is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 lanzdale User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to detect if an application created a file.

I've got a partial solution to this problem, wonder if anyone can add.

I want to run some business application progran on a Windows 2000 Server (it's an import program), then check if it created a specific file. I use the method:

System.Diagnostics.Process.Start(strCmd)

Which is supposed to be Syhchronous (waits for process to end before returning control), a big advantage over the old vb.

Then I use: System.IO.File.Exists(strFileName) to test wether the command ran OK. It usually works, but sometimes, even though manual inspection shows it was created, not which tells me System.Diagnostics.Process.Start in this case might not be synchronous.

I'm told the process I'm running may spawn other processes itself.

1) What can I run that waits for ALL processes to end, not just the parent,
2) or is Process.Start supposed to do this, I'm doing something wrong,
3) or is there at least an easy way to wait for a file -say 2 seconds and time out if none found by then?
4) Any other suggestions?

I'm using a vb.net code behind dll if that makes a difference,
but I assume C# is the same.

John

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > How to detect if an application created a file.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT