Board index » delphi » Sharing Violation on attached file even after disconnect
Chris Mathews
![]() Delphi Developer |
Chris Mathews
![]() Delphi Developer |
Sharing Violation on attached file even after disconnect2003-10-17 01:40:07 AM delphi109 After sending an email with attachment using TIdSMTP and TIdMessage, I cannot access the file on the hard drive that was the attachment (Sharing Violation). This is even after IdSMTP.Disconnect. I have also tried DisconnectSocket and even Destroy, but still no luck. I can only access the file after I close my application. I am trying to delete the file after disconnect because it is a temporary file in the TEMP folder. Is there any way to unlock the file after the Send is completed? Otherwise the TEMP folder will grow forever. Thank you for any help that anyone can offer. |
Remy Lebeau (TeamB)
![]() Delphi Developer |
2003-10-17 03:29:40 AM
Re:Sharing Violation on attached file even after disconnect
"Chris Mathews" <XXXX@XXXXX.COM>writes
QuoteAfter sending an email with attachment using TIdSMTP and TIdMessage, I QuoteI am trying to delete the file after disconnect because it is a TIdAttachment itself is freed. QuoteIs there any way to unlock the file after the Send is completed? left open during the send itself at all. Gambit |
Chris Mathews
![]() Delphi Developer |
2003-10-17 04:50:30 AM
Re:Sharing Violation on attached file even after disconnect
Thank you for responding. I have found the issue with the locked file. I
will try your "DeleteTempFile" suggestion though for the temp file deletion. Thanks again,CM "Remy Lebeau (TeamB)" <XXXX@XXXXX.COM>writes Quote
|