PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US

  • Overview
  • Operations on the content of external files
  • Example
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 example),
  • the directories of your disks (directory creation for example).
Versions 15 and later
Android The management of external files is now available for the Android applications.
New in version 15
Android The management of external files is now available for the Android applications.
Android The management of external files is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App The management of external files is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App The management of external files is now available for the Windows Phone applications.
Universal Windows 10 App The management of external files is now available for the Windows Phone applications.
Versions 18 and later
Android Widget The management of external files is now available in Android Widget mode.
Universal Windows 10 App The management of external files is now available in Windows Store apps mode.
New in version 18
Android Widget The management of external files is now available in Android Widget mode.
Universal Windows 10 App The management of external files is now available in Windows Store apps mode.
Android Widget The management of external files is now available in Android Widget mode.
Universal Windows 10 App The management of external files is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
Universal Windows 10 App This feature is now available in Universal Windows 10 App mode.
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.
    Windows Mobile This option is not available.
  • 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.
WINDEVWEBDEV - Server codePHP

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 the 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.
Windows Mobile

Example

Your program manages a ".TXT" file. The functions for managing the 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.
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 huge 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
Android The management of directories in Android presents the following specific features:
  • By default, the current directory of an application corresponds to the "files" sub-directory that is automatically created at the root of the setup directory of the application.
  • The relative paths handled by the application are relative to this directory.
  • The full path of current directory is returned by fCurrentDir. By default, you have the ability to read and write in this directory.
  • The current directory can be modified by fCurrentDir.
  • The runtime directory (returned by fExeDir) corresponds to the setup directory of the application. By default, the applications are always installed in the /data/data/<package name>.<application name> directory.
  • In Android, the file system is read-only on the device and on the emulator. An application has the rights to write into its setup directory or into one of its sub-directories, as well as onto the external memory (SDCard).
  • The "databases" directory is also automatically created at the root of the setup directory of the application to store the SQLite databases handled by the application (unless a specific path was specified during the connection). The path of "databases" directory is returned by fDataDir.
  • To have a storage location common to several applications, use the external memory (SDCard for example). The path of external memory is returned by SysDirStorageCard. To have a storage location common to several applications, use the external memory (SDCard for example). The path of a directory for storing files in the external storage space is returned by SysDirExternalStorage.
  • If the user connects his device to the PC in "mass storage" mode (or in "disk drive" mode), the SD Card is automatically uninstalled from the device and it is no longer accessible from the device. All the applications installed on the SD Card and currently operating are killed. As long as the SD Card is uninstalled, you cannot:
    • start the applications installed on the SD Card.
    • access the SDCard from the applications run on the phone.
For more details, see:
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
WD HTML Export Training (WINDEV): WD HTML Export
[ + ] This example explains how to export data in HTML format with the WLanguage functions.
The following topics are presented in this example:
1/ the functions for managing the external files for generating the HTML file
2/ the operations performed on the HTML tags
3/ the generation of an HTML report
The generation of an HTML page is performed from the data found in a memory table.
By programming
The principle consists in generating a text file with a "HTM" extension. The WLanguage function named "fWrite" will be used.
This example easily writes the text strings by respecting the syntax of the HTML language.
Automatically
The principle consists in creating a report on table based on the memory table that was previously filled.
The printout is requested with an HTML output.
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
PC Pocket Picker Windows Components (WINDEV Mobile): PC Pocket Picker
[ + ] PC Pocket Picker

This example proposes a component used to select a file or a directory found on the Pocket PC linked to the PC.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment