I/O Exception Error

namanupadhyaynamanupadhyay Member Posts: 8
edited 2013-09-08 in NAV Three Tier
Hi All,

I have made a XML Port to import the txt file and calling it from a codeunit. The data is importing. I am facing the problem when I want to move the file from one folder to another. I am using the COPY command but it is giving me an error as : An I/O exception occurred during the operation.

Can anybody help me on this.
Thanks in advance.
Naman Upadhyay
Technical Consultant

Comments

  • nsaleronnsaleron Member Posts: 3
    Hi,

    Could you provide the code inside your codeunit?

    If you try to move your file inside the Xmlport or when you go back in the codeunit, you get that kind of error because the file stream is still opened.
    Regards,
    Nicolas Saleron
  • namanupadhyaynamanupadhyay Member Posts: 8
    Hi,

    My code is as follows :-


    File.TEXTMODE(TRUE);
    File.WRITEMODE(FALSE);
    File.OPEN(txtFileName);
    File.CREATEINSTREAM(StreamIn);
    XMLPORT.IMPORT(XMLPORT::"Import Sales Invoice", StreamIn);
    File.CLOSE;


    IF EXISTS(FromtxtFileName) THEN
    BEGIN
    COPY(FromtxtFileName,TotxtFileName);
    END;

    COPY is giving me this error.
    Naman Upadhyay
    Technical Consultant
Sign In or Register to comment.