Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWDirRemove

FWDirRemove(cDir, [lComplete], [lKillFiles]) --> lRet

Removes directories under explicit options.

FWDirRemoveAdvPL
01 · OVERVIEW

Overview

Removes the last level or empty path under lComplete. lKillFiles allows recursive deletion in the requested tree; this is not a neutral directory lookup. The example keeps additional destructive options false and never evaluates the block. No directory is removed. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWDirRemove(cDir, [lComplete], [lKillFiles]) --> lRet

Parameters

cDir
CharacterRequired

Validated test path.

lComplete
LogicalOptional

Removes the entire empty path when true.

lKillFiles
LogicalOptional

Allows deletion of files and the requested subtree.

Return value

Logical success.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed418()
    Local bAction := {|cPath| FWDirRemove(cPath,.F.,.F.)}
    // Do not evaluate: check path and ownership first.
Return Nil
Expected result

Prepared callback; filesystem unchanged. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check context and return before integration; the example does not replace a complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWDirRemove. TDN. Accessed on 2026-10-26.
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