timport file lock

aitchon
Posts: 119
Joined: Mon Jan 22, 2007 10:30 am

timport file lock

Post by aitchon »

I'm looping through a set of files in a directory and timporting the records from those files into a table. I want to be able to move the files to a backup directory after I timport the records, but I get this error:

Cannot mv output.txt to \backup\output.txt: The process cannot access the file because it is being used by another process.

Here's my code:

<stat NAME="*.txt" ROW MAXDEPTH=1 ALL $importdir>
<$importfile=$ret>
<timport row $schema1 FROMFILE $importfile>
<!-- insert into table -->
</timport>
<sysutil mv $importfile $backupdir>
</stat>
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

timport file lock

Post by Kai »

This is a known issue we're working on. A fix should be available in a few weeks.
User avatar
John
Site Admin
Posts: 2625
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH

timport file lock

Post by John »

If the files are not excessively large you may be able to use <read> to read in the file and then timport the data, e.g.

<read $importfile>
<timport row $schema1 $ret>
John Turnbull
Thunderstone Software