Rank: Advanced Member
Joined: 10/17/2007 Posts: 56 Location: Seattle
|
I use to be able to read in a flat file add one to its values and then write back the values to the same file. (before 2008 rel. 2) now when I generate the code I get a "The process cannot access the file because it is being used by another process"
anyone else run into this or know of a solution?
File Attachment(s):
add1.zip (2kb) downloaded 435 time(s).
ellerbe attached the following image(s):

|
Rank: Advanced Member
Joined: 10/17/2007 Posts: 56 Location: Seattle
|
This is the fix from Altova support
this effect was a side effect of the new Stream I/O interfaces. I have now entered this into our internal bug database for our developers to take a look at. The bug entry number is TTP # 26390.
Please note as a workaround you could change the following in the code:-
You can create StringOutput instead of default FileOutput in generated MappingConsole.cs and then dump the results of the string into the source file as shown below:
Altova.IO.Input theSource = new Altova.IO.FileInput("C:/home/sven/tmp/the.txt"); //Altova.IO.Output the2Target = new Altova.IO.FileOutput("C:/home/sven/tmp/the.txt");
Altova.IO.StringOutput the2Target = new Altova.IO.StringOutput(new System.Text.StringBuilder());
MappingMapTothe2Object.Run( theSource, the2Target);
// Dump text into the same file System.IO.TextWriter writer = new System.IO.StreamWriter("C:/home/sven/tmp/the.txt", false); writer.Write(the2Target.Content.ToString());
|