CFile:Flush CFile:Access Modes

CFile:GetPath


The GetPath method returns as a string the full path name of the file attached to the CFile.

Syntax

sPath = CFile:Path()

sPath = CFile:Path( nMaxChars )

Example

Suppose a CFile object F is attached to a file opened from the path sPath, which is 'C:\My Folder\My File.txt'. Then

 

F = CFile:new()

-- Create a new CFile

F:Open( sPath, "r+t" )

-- open the file as text, for read and write

Printf( "%s\n", F:GetPath() )

-- prints 'C:\My Folder\My File.txt'

Printf( "%s\n", F:GetPath(20) )

-- prints 'C:\...\My File.txt'

Related Topics

CFile, Open, CSplitpath