Am trying to move file from one folder to another using System.IO.File. Unfortunately, it does not work, but when I make use of the copy method, the file replicates itself on the specified directory. See code below for your reference. Thanks in advance.
for(rowNo = 1; rowNo <= conLen(pCountFiles) ; rowNo++) { fileDetails = fileNameSplit(conPeek(pCountFiles, rowNo)); pCountFileName = conPeek(fileDetails, 2); newMoveFileDir = strFmt('%1/%2/%3', sharedFolder, pCountProcessFiles, pCountFileName); permissionSet = new Set(Types::Class); permissionSet.add(new FileIOPermission(fileName, 'rw')); permissionSet.add(new FileIOPermission(newMoveFileDir, 'rw')); permissionSet.add(new InteropPermission(InteropKind::ClrInterop)); CodeAccessPermission::assertMultiple(permissionSet); if(System.IO.File::Exists(newMoveFileDir)) System.IO.File::Delete(newMoveFileDir); System.IO.File::Move(filename, newMoveFileDir); CodeAccessPermission::revertAssert(); }