MOVE FILE FROM ONE FOLDER TO ANOTHER FOLDER USING X++

Below is for Moving files in Batch Job process :

server static void moveFile(str fileName, str newFileName)
{
    Set                 permissionSet;
    permissionSet =  new Set(Types::Class);
    permissionSet.add(new FileIOPermission(fileName, #io_write));
    permissionSet.add(new FileIOPermission(newFileName, #io_write));
    permissionSet.add(new InteropPermission(InteropKind::ClrInterop));
    CodeAccessPermission::assertMultiple(permissionSet);
    System.IO.File::Move(fileName, newFileName);
    CodeAccessPermission::revertAssert();
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s