ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the name of an external file currently open. This file was opened using one of the following functions: fOpen, fCreate or fOpenTempFile.
Example
IDMonFichierTest is int 
NomFichier is string 
IDMonFichierTest = fCreate("C:\temp\TestCreation.txt")
NomFichier = fFileName(IDMonFichierTest)
Info("Le fichier " + fExtractPath(NomFichier, fFile + fExtension) + ...
	" a été créé dans le répertoire " + fExtractPath(NomFichier, fDrive + fDirectory))
NomFichier is string 
MonFichier is DiskFile
MonFichier = fCreate("C:\temp\TestCreation.txt")
NomFichier = fFileName(MonFichier)
Info("Le fichier " + fExtractPath(NomFichier, fFile + fExtension) + ...
	" a été créé dans le répertoire " + fExtractPath(NomFichier, fDrive + fDirectory))
Syntax
<Result> = fFileName(<File used>)
<Result>: Character string
Name and full path of the external file.
<Result> is a character string of the same type as the one passed to fOpen, fCreate or fOpenTempFile:
  • If these functions handled an Ansi character string, <Result> will be in Ansi format.
  • If these functions handled a Unicode character string, <Result> will be in Unicode format.
<File used>: Integer or DiskFile variable
Remarks
Reports and Queries

Operating mode in Windows Vista (and later)

If this function does not work properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: If you need to manipulate / modify files or directories, without needing administrator privileges, it is advisable:
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
Component: wd300std.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help