Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWFileWriter

FWFileWriter():New(cFileName, lBuffer, [nBuffer])

Writes files directly or through a buffer.

FWFileWriterAdvPL
01 · OVERVIEW

Overview

The class specializes file writing. lBuffer selects string buffering and nBuffer is available from LIB 20201009. Write reports logical processing, but buffered physical output may wait for the threshold or Close; isolated success is not full durability. The example prepares an uninvoked constructor without creating files. Opening, supplying content and replacement policy need the full implementation contract. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWFileWriter():New(cFileName, lBuffer, [nBuffer])

Parameters

cFileName
CharacterRequired

Complete test path in the execution context.

lBuffer
LogicalRequired

Enables string buffering.

nBuffer
NumericOptional

Buffer size; LIB 20201009+.

Methods

NewDefines file and buffer policy.FWFileWriter():New(cFileName,lBuffer,[nBuffer])
WriteProcesses writing under the buffering policy.o:Write() --> lRet
CloseCloses and flushes remaining buffer.o:Close()
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed423()
    Local bPrepare := {|cPath| FWFileWriter():New(cPath,.T.)}
    // Do not evaluate: no file created or overwritten.
Return Nil
Expected result

Configuration block; no write performed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check LIB version, lifecycle and context before integration. These methods are a documented subset rather than the complete API.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWFileWriter. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha