cArquivoCreation name and path.
AdvPL GuideFCreate( cArquivo, [nAtributo], [xParam3], [lChangeCase] ) --> nRetCreates an empty file or truncates an existing one.
FCreate is not neutral opening: an existing file is emptied. A valid handle is at least zero; -1 indicates failure. Keep compatibility arguments Nil/zero as documented; lChangeCase depends on build and configuration. The GitHub example creates TEST.TXT without checking creation before closure. This adaptation only prepares an uninvoked callback. A prior File check cannot eliminate races with another process. (TOTVS, n.d., ref. 1)
FCreate( cArquivo, [nAtributo], [xParam3], [lChangeCase] ) --> nRetcArquivoCreation name and path.
nAtributoCompatibility: Nil or zero.
xParam3Compatibility: Nil.
lChangeCaseFilename case handling according to build/configuration.
Handle >= 0; -1 on failure.
#Include "Protheus.ch"
#Include "Fileio.ch"
User Function Ed380()
Local bCreate := {|cNewFile| FCreate(cNewFile)}
// Do not evaluate: FCreate can erase existing content.
Return NilBlock prepared without creating or truncating a file. 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.