IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

I use to be able to take input from a file modify it and write it back to the same file Options · View
ellerbe
Posted: Thursday, June 5, 2008 5:26:00 PM
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):
add1.PNG

ellerbe
Posted: Wednesday, June 11, 2008 6:40:09 PM
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());


Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.