ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Overview
  • Operations on the content of external files
  • Example
  • Handling files
  • Example
  • Handling the disks and their directories
  • Managing the files and directories in Android
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WINDEV, WINDEV Mobile and WEBDEV propose several functions allowing you to manage the external files from your WINDEV or WINDEV Mobile applications or from your WEBDEV sites.
An external file is a file with direct access, also called "text file". The external files can have any type (".TXT", ".INI", ...). The external files can contain:
  • readable characters (in character string format),
  • non-readable characters (in binary format).
Caution: Do not confuse external file and HFSQL file. The HFSQL files are data files and they must be handled by the HFSQL functions.
WINDEV, WINDEV Mobile and WEBDEV propose three groups of functions used to handle:
  • the content of your external files,
  • the files found on your disks (file copy for instance),
  • the directories of your disks (directory creation for instance).
Operations on the content of external files
WINDEV, WINDEV Mobile and WEBDEV allow you to:
  • create, open and close your external files.
  • manage the lock for your external files.
  • read the content of your external files: read a line or a block of bytes (characters).
  • write into your external files: write a line, a character string or a section of memory.
  • move in your external files.
WINDEV

Example

Your program manages a ".INI" file whose size exceeds 64KB. This ".INI" file is too large to be handled by the INI functions. The functions for managing external files allow you to handle this file.
To retrieve the content of this file: read the content of the file and assign the information read into a section of memory.
To modify the content of this file: add various information into this file at a given position.
This file must be partially locked in order to be updated: lock this file. This file will only be accessible by the application that locks it.
Handling files
WINDEV, WINDEV Mobile and WEBDEV allow you to:
  • compress and encrypt the files.
  • find out the characteristics of a file.
  • find out and modify the name and path of the files.
  • compare the content of several files.
  • list the files found in a directory by running a procedure that performs a process on each file.

Example

Your program supports large files containing confidential information. Encrypt and compress these files before transferring them by network.
Perform a search on your files and run a specific procedure on the files found.
Handling the disks and their directories
WINDEV, WINDEV Mobile and WEBDEV allow you to:
  • get information about the accessible directories and disks.
  • handling directories.
Managing the files and directories in Android
Related Examples:
The fListFile function Unit examples (WINDEV): The fListFile function
[ + ] Using fListFile and its syntax that directly returns the list of files/directories found in string format.
Handling text files Unit examples (WINDEV): Handling text files
[ + ] Handling "text" files with WINDEV:
- Create a text file
- Write into a text file
- Read in a text file
The TableTo functions Unit examples (WINDEV): The TableTo functions
[ + ] Exporting table data with the WLanguage functions.
The following topics are presented in this example:
1/ interfacing with Word and Excel
2/ sending data to the clipboard
3/ generating a text file
This example explains how to export the content of a table to a Word document, an Excel workbook, the clipboard or a text file via the following WLanguage functions: TableToWord, TableToExcel, ToClipboard, TableToText.
Handling text files Unit examples (WEBDEV): Handling text files
[ + ] This example explains how to handle "non HFSQL" files with WEBDEV and it allows you to:
- Create a text file
- Write into a text file
- Read in a text file
WD File Synchronization Complete examples (WINDEV): WD File Synchronization
[ + ] This example is used to synchronize two file directories in WLanguage. After the synchronization, the destination directory and the source directory are identical. The comparison is based on the presence and on the date of the files. This can be very useful to manage the backups.
In this example, we will present the functions for handling the files on disk.

Summary of the example supplied with WINDEV:
Select a source directory containing the files to save and a destination directory where these files will be saved. Start the synchronization. The application will compare the content of the two directories. If the file is not found, if the source file is more recent, then the file will be updated in the backup directory.
Handling text files Unit examples (WINDEV Mobile): Handling text files
[ + ] Handling external "text" files:
- Create a text file
- Write into a text file
- Read in a text file
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help