Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

DiskSpace

DiskSpace( [nDrive] ) --> nBytesFree

Discontinued reference for free space on a Windows workstation.

DiskSpaceAdvPL
01 · OVERVIEW

Overview

TOTVS marks DiskSpace as unsupported or discontinued. The historical function measures a Windows SmartClient workstation drive rather than AppServer disk. The page states that default zero returns -1 and interface-free JOB execution also returns -1; DiskSpace() is therefore not a universal measurement. The example only prepares an explicit-drive call. Bytes depend on the environment and -1 indicates failure, not negative space. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

DiskSpace( [nDrive] ) --> nBytesFree

Parameters

nDrive
NumericOptional

Historical drive: 1=A, 2=B, 3=C; default 0 has a documented caveat.

Return value

Free bytes; -1 on failure under the historical reference.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed355()
    Local bMeasure := {|| DiskSpace(3)}
    // Legacy call prepared without querying workstation drive C:.
Return Nil
Expected result

Block prepared without measurement; no fixed size is expected. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not use it to monitor server capacity or validate paths without platform checks.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. DiskSpace. 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