Rename the file after an import dataport

poppinspoppins Member Posts: 647
Hi everyone,
I used a dataport to export some data and another one to import the generated file.
I need to rename the file after importing the data.
I tried the following code in the OnPostDataport trigger:
FILE.RENAME(C:\Users\aaa\bbb\ddd.txt ,C:\Users\aaa\bbb\yyy.txt );
I got the following error:
You cannot use the file C:\Users\aaa\bbb\ddd.txt  because it is already in use.
What shall I do?
Thanks in advance :)

Comments

  • yukonyukon Member Posts: 361
    Hi poppins,

    Here is ans. for you
    Dataport - OnPostDataport()
    txtOldFileName := CurrFile.NAME;
    CurrFile.CLOSE;
    RENAME(txtOldFileName,'C:\2.TXT');

    Regards,
    Yukon
    Make Simple & Easy
Sign In or Register to comment.