Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TXT file doesn´t close
Message
From
22/10/2015 12:11:10
 
 
To
22/10/2015 11:39:30
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB.NET 1.1
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01626227
Message ID:
01626343
Views:
35
>>>>Hello Viv;
>>>>
>>>>The CM.TXT file is the destinetion file.
>>>>
>>>>This error happen when all the file have been added.
>>>>
>>>>Thanks a lot for your time, I really apreciate it....
>>>>
>>>>Best regards;
>>>
>>>Do you mean that the error actually happens in some statement *after* the code you show and not within the loop ?
>>>If it happens *within* the loop then, by definition, all files would *not* have been added....
>>
>>unless destination file is within the directory, and if not blockec and using pure file handling instead of a mix of mem / file throws error before or instead of filling the whole HD ;-)))
>
>Yea, if he's reading and writing to the same file, the StreamReader will keep the file open with a read lock causing the error. Switching to File.ReadAllText instead of a StreamReader or reading and writing as separate steps may fix it.


Or a simple if clause skipping the destination file from the reading process ;-))
Previous
Reply
Map
View

Click here to load this message in the networking platform