ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Closing a file opened several times
  • Closing a locked file
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Closes an external file.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)Ajax
ResFerme is int
// Ouverture d'un fichier externe 
MonFichierTxt is DiskFile
IF MonFichierTxt.Open("C:\MesRépertoires\Fichier.txt", foReadWrite) = True THEN
	...
	// Fermeture du fichier externe
	ResFerme = MonFichierTxt.Close()
END
Syntax
<Result> = <File used>.Close()
<Result>: Integer
  • 0 is the external file is closed,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant. <DiskFile variable>.Close throws an error if the file is not opened.
<File used>: DiskFile variable
Name of the DiskFile variable initialized with <DiskFile variable>.Open or <DiskFile variable>.Create.
Remarks

Closing a file opened several times

The same file can be opened several times simultaneously. Each version of the file must be closed individually via its own identifier.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)Ajax

Closing a locked file

A blocked file is automatically unblocked when you close it.
Reminder The <DiskFile variable>.Lock function is used to block an external file. <DiskFile variable>.Unlock is used to unlock an external file.
Business / UI classification: Business Logic
Component: wd300std.dll
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help