-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: GLPrasad
Message 1 in Discussion

Hi Friends,   I am trying to create pdf files from text files that are given to me as 
output with the help of Windows Service where I have a file system watcher, that 
watches for any new text file to be input.   Once a text file is dropped in the 
folder, the file is processed and a pdf file is generated.  What I do there is read 
the text file using a stream reader, close the file and start processing the PDF using 
third party converters.   Now my problem is, after converting the file, the handle to 
the text file is not released.  When I delete the text file already dropped and drop 
another file with the same name, the windows service throws me an error saying the 
text file is held by another process.   I am doubly sure that the stream reader has 
been closed.  I tried it another way, creating a file stream and then a stream reader 
and closing them.  Even this does not solve the problem.  I tried another way ... by 
using the using statement in C#.  Still the problem continues.   Of late, I tried to 
write a windows application, to do a base 64 encoding provided by the base class 
libraries.  What i do is, read any file, base 64 encode it ... and save it as another 
file and close all the readers.  Now here when the windows application is running, 
even after the conversion process is over, the handle is still being held by the exe.  
 I tried both the Debug and Release versions of the project.  Both of them behave the 
same way (My suspicion was that the debugger held the file handle).   Could any one 
suggest me how to overcome this problem ?   Any help to get over this would be of real 
help.   Thanks, Prasad GL

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to