cArquivoSource with extension and applicable path.
AdvPL GuideFRename( cArquivo, cNovoArq, [nParam3], [lChangeCase] ) --> nRetRenames a file and can move it to another path.
FRename returns zero on success and -1 on failure. Source files must be closed and wildcards are unsupported. Different directories make it a move, with documented server/workstation and JOB restrictions. The GitHub example uses workstation paths; this adaptation prepares a parameterized callback without moving files. Neither safe overwrite nor atomic move is established by the page. (TOTVS, n.d., ref. 1)
FRename( cArquivo, cNovoArq, [nParam3], [lChangeCase] ) --> nRetcArquivoSource with extension and applicable path.
cNovoArqNew name and target.
nParam3Compatibility: Nil.
lChangeCaseFilename case handling according to build/configuration.
Zero on success; -1 on failure.
#Include "Protheus.ch"
#Include "Fileio.ch"
User Function Ed395()
Local bRename := {|cSource,cTarget| FRename(cSource,cTarget)}
// Do not evaluate: verify closed files and destination before moving.
Return NilCallback prepared without renaming or moving. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.