Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWFileIOBase

FWFileIOBase():New(cFileName, [nBuffer])

Centralizes file operations and diagnostics.

FWFileIOBaseAdvPL
01 · OVERVIEW

Overview

The base class groups opening, closure, existence, creation and deletion. New takes a complete path; nBuffer is documented from LIB 20201009. Open uses Fileio.ch modes and error returns a diagnostic object. clear deletes and can recreate the file rather than merely clearing memory. This example only prepares a constructor callback without file operations. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWFileIOBase():New(cFileName, [nBuffer])

Parameters

cFileName
CharacterRequired

Complete test path in the execution context.

nBuffer
NumericOptional

Buffer size; LIB 20201009+.

Methods

NewPrepares instance path and buffer.FWFileIOBase():New(cFileName, [nBuffer])
Open / CloseOpens with Fileio.ch mode and closes the owned file.o:Open([nMode]) / o:Close()
ErrorGets the diagnostic object.o:Error()
Clear / EraseDestructive file operations.o:Clear(lCreate) / o:Erase()
03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed421()
    Local bPrepare := {|cPath| FWFileIOBase():New(cPath)}
    // Do not evaluate: supply a complete test path.
Return Nil
Expected result

Constructor wrapped in a block without file access. 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. FWFileIOBase. 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