Sage X3 version 7 has a new function to rename a file. With this simple function we can rename a file.
renameFile: This function can be used to rename the file . This function returns a status 0 on success or a negative code.
New Stuff:How to do Location change of specific document through code…?
Syntax: RETURN_STATUS=renameFile(PATH,PATH1)
Parameter Details:
- PATH: The path where file is located
- PATH1:The path with new file name
- RETURN_STATUS: Its status of file.
Points to be noted here is,
• This function superseeds System “ren”-PATH-PATH1on Windows and System “mv”–PATH-PATH1on Unix. It is faster because it does not fork a process.
Return value | Status |
0 | Operation succeeded |
-20 | File does not exist |
-27 | Access denied |
Kindly refer to the below snippet of code for better understanding the renameFile function:
Hope this Helps!
Also Read:
1.Deleting a file from a directory
2.How to find the current source file name
3.How to open Sage ERP X3 Code file in eclipse folder in version 7