Client and server files in Protheus
Identifies where File looks before designing a read workflow.
Overview
A path alone does not identify the machine. File accepts nWhere: 0 applies relative paths on Application Server and absolute paths on SmartClient; 1 searches the Application Server installation directory; 2 the SmartClient installation directory. In a Job, an absolute client-path lookup can return false and FError -1. lChangeCase affects case handling according to build and configuration. Existence does not establish read permission, content identity or transfer between machines. (TOTVS, n.d., ref. 1)
Return value
No single return value: this is a composite workflow.
Commented example
#Include "Protheus.ch"
User Function EdFiles()
Local cFile := "editorial-test.txt"
// Interactive session: lookup only, no creation or transfer.
ConOut(cValToChar(File(cFile, 1, .F.)))
ConOut(cValToChar(File(cFile, 2, .F.)))
Return NilTwo logical values depending on actual files at each installation. No fixed result or transfer is implied. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Define machine, allowed directory, name and error handling before opening. Do not accept arbitrary user paths; test SmartClient and Job separately.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.