Dave, I didn't know of FileMon... Thanks I just downloaded it. Thanks for the suggestion.
Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 | [EMAIL PROTECTED] -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of dave wanta Sent: Friday, November 18, 2005 8:55 AM To: [email protected] Subject: Re: [AspNetAnyQuestionIsOk] File still in use error I would go to sysinternals and download filemon to see what has the file locked. However, I know there are issues using the Filesystemwatcher, and it may simply be that the app that modified the file didn't release it quickly enough. ----- Original Message ----- From: Dean Fiala To: [email protected] Sent: Thursday, November 17, 2005 9:29 PM Subject: Re: [AspNetAnyQuestionIsOk] File still in use error Travis, Do you have the Indexing Service on, on this server? If so, turning it offf, might solve the problem. On 11/17/05, Falls, Travis D (HTSC, CASD) <[EMAIL PROTECTED]> wrote: > I have the following method in a utility class I created that is instantiated via a singleton. I think begin my file work load that can be 100 files... I start 10 threads that do a copy, rename, delete, script work load. During these threads I create files based on the work item's ID for example S053R.state with the method below. Every step of the way I call the below method to serialize an object to maintain state incase the system goes down or the transfer fails. > > My questions: > > 1. Why do I keep getting the: > 2005-11-17 14:22:40,305 [2096] ERROR com.TheHartford.HTSC.RAFT.FileWatcher.Utilities [(null)] -EXCEPTION: Access to the path "C:\RAFT.NET\Service\State\IDs\TDF02.state" is denied. System.UnauthorizedAccessException: Access to the path "C:\RAFT.NET\Service\State\IDs\TDF02.state" is denied. > at System.IO.__Error.WinIOError(Int32 errorCode, String str) > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, > FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) > at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) > at System.IO.FileInfo.Create() > at com.TheHartford.HTSC.RAFT.FileWatcher.Utilities.DoSerialize(String Path, String Name, Object o) in c:\raft\filewatcher\code\utilities.cs:line 438 > > 2. would it be better to create a state engine using MSMQ instead? > > Any help would be greatly appreciated; I have been struggling with this one for a while. I feel like I am closing everything and I know this is the only method and process that creates and deletes these files. > > > public void DoSerialize(String Path, String Name, object o) { > lock (syncRoot2){ > try{ > object j = new object(); > j = o; > DirectoryInfo di = new DirectoryInfo(Path); > FileInfo[] finfos = di.GetFiles(Name); > for(int i = 0; i < finfos.Length; i++){ > FileInfo file = finfos[i]; > try{ > file.Delete(); > } > catch (FileNotFoundException fnfe){ > log.Error("FILE NOT FOUND: " + fnfe.ToString() + " " + fnfe.Message); > } > catch (IOException fnfe){ > log.Error("IO EXCEPTION: " + fnfe.ToString() + " " + fnfe.Message); > } > } > FileInfo fi = new FileInfo(Path + Name); > using (Stream myFileStream = fi.Create()){ > SoapFormatter serializer = new SoapFormatter(); > serializer.Serialize(myFileStream, j); > DoGarbageCollection(); > } > } > catch (Exception ex){ > DoMessaging("FWE00017", ex.Message + " " + ex.ToString(), GetDateNowDateTime()); > log.Error("EXCEPTION: " + ex.Message + " " + ex.ToString()); > } > } > > > ************************************************************************* > This communication, including attachments, is > for the exclusive use of addressee and may contain proprietary, > confidential and/or privileged information. If you are not the intended > recipient, any use, copying, disclosure, dissemination or distribution is > strictly prohibited. If you are not the intended recipient, please notify > the sender immediately by return e-mail, delete this communication and > destroy all copies. > ************************************************************************* > > > > > > Yahoo! Groups Links > > > > > > > -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com ------------------------------------------------------------------------------ YAHOO! GROUPS LINKS a.. Visit your group "AspNetAnyQuestionIsOk" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------------------------------------------------------------ [Non-text portions of this message have been removed] Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> 1.2 million kids a year are victims of human trafficking. Stop slavery. http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
