ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Note: These functions are also available in prefix syntax (Functions for handling directories and external files (prefix syntax)).
The following functions are used to manage external files:
fAddBufferAdds the content of a buffer at the end of a file.
fAddTextAdds the content of a character string at the end of a file.
fAttributeReturns or modifies the attributes of a file.
fAttributeReadOnlyGets and sets the read-only attribute of a file.
fBuildPathBuilds a complete file path from the directory and short name of a file. This function is mainly used to get a valid file name without having to worry about the presence of separators in the path ('/' or '\') or about their direction according to the platform.
fBuildRelativePathReturns the path to a file relative to a reference directory.
fCacheDirReturns the path of directory that will be used to store the data in cache on the internal storage space of application.
fChangeExtensionChanges the extension of a file on disk.
fChangeSizeResizes an external file.
fCloseCloses an external file.
fCompareCompares the content of two files bit by bit.
fCompressCompresses a file.
fContentTypeReturns the type of file according to the MIME standard (Multipurpose Internet Mail Extensions).
fCopyDirCopies the contents of a directory and its subdirectories.
fCopyFileCopies one or more files (regardless of their attributes).
fCopyFileWebFolderCopies an image file from the data directory of application (or from one of its sub-directories) to the "_WEB" directory of application (or to one of its sub-directories).
fCreateCreates an external file.
fCreateLinkCreates a link on a file at the specified location.
fCurrentDirIdentifies or modifies the current directory.
fCurrentDriveGets or sets the current drive.
fDataDirReturns the full path of the directory of HFSQL data files specified by the user when installing the application.
fDataDirCommonReturns a directory path for the shared data of the current application:
  • between all the users of the computer
  • between all the TSE users
This directory can be used without restriction in Windows XP, Vista, ... This directory is used to store: 
  • the files for the general configuration of the application (.INI files, .XML files, etc.).
  • the data files common to all the users (HFSQL .fic, .ndx and .mmo files).
fDataDirUserReturns a directory path for the data of the current user of the current application.
fDateReturns or modifies the different dates associated with a file or directory (date created, modified or accessed).
fDateTimeReturns or modifies the different dates and times associated with a file or directory (date created, modified or accessed).
fDecryptDecrypts a file that was encrypted by fCrypt.
fDeleteDeletes a file accessible from the current computer.
fDeleteFileWebFolderDeletes an image file from the "_WEB" directory of the application (or from one of its sub-directories).
fDetectRemovableStorageDetects whether a removable storage unit (CD, USB key, USB camera, ...) was added or removed.
fDirFinds a file or directory.
fDirAttributeReturns or modifies the attributes of a directory.
fDirectoryExistChecks the existence of a directory.
fDirExistChecks the existence of a directory.
fDirRenameRenames a directory.
fDirSizeReturns the size of a directory in bytes.
fDriveInfoReturns information about a drive.
fDriveReadyDetermines:
  • if a given drive (storage card, CD or DVD) is available,
  • whether the drive exists.
fEncryptEncrypts a file in binary or ASCII format.
fExeDirReturns the directory from which the execution is started.
fExtractPathReturns the different elements of a path: drive, directories, name and extension of the file.
fExtractResourceExtracts a resource from the application into a physical device location.
fFileExistChecks the existence of an external file.
fFileNameReturns the name of an external file currently open.
fFindFinds a character string or a buffer in a file opened by fOpen.
fGlobalDirCommonReturns a directory path for the global data of current application (data shared between several applications), regardless of the current user.
fGlobalDirUserReturns a directory path for the global data of current application (data shared between several applications), for the current user.
fGraphicFilterReturns the list of image formats supported by the current platform, in the format expected by the filter of fSelect.
fImageSelectOpens the image picker of Windows.
fInsertTextAtBeginningInserts text at the beginning of a file without overwriting the existing text.
fIsImageDetermines whether a file on disk or in a buffer corresponds to an image format recognized by WINDEV or WEBDEV.
fListDirectoryLists the subdirectories of a given directory and returns the full paths of listed subdirectories.
fListDiskReturns the list of disks installed on the computer.
fListFileLists the files found in a directory and returns the list of files.
fListResourceLists the resources integrated to the application.
fLoadBufferLoads the content of an external file (text, image, ...) in a buffer variable.
fLoadResourceLoads the content of a resource from a library.
fLoadTextLoads the contents of a text file into any text field or variable (string variable, window edit control, report label field, etc.).
fLockEntirely or partially locks an external file.
fLongNameReturns the long name of a file or directory.
fLongPathReturns the full long path of a file or directory.
fMakeDirCreates a directory (and the intermediate directories if necessary).
fMergeMerges several files into a single one.
fMIMETypeReturns the type of file according to the MIME standard (Multipurpose Internet Mail Extensions).
fMoveDirMoves a directory and its content.
fMoveFileMoves a file from one directory to another.
fOpenOpens an external file (ANSI or UNICODE) for programmatic manipulation.
fOpenTempFileCreates and opens a temporary file.
fParentDirReturns the path of the parent directory for the specified directory.
fReadReads:
  • a block of bytes (characters) in an external file (ANSI or Unicode),
  • the content of an external file (ANSI or Unicode) and assigns it to a memory area.
fReadLineReads a line from an external file (ANSI or Unicode).
fReadLineRegularExpressionReads a line in an external file, gets sections of this line according to a regular expression and assigns them to a variable.
fRemoveDirDeletes a directory from a disk.
fRenameModifies the name of a file.
fReportsAndQueriesDirReturns:
  • the full path of the directory for the custom reports and queries. This directory corresponds to the directory of the reports and queries visible by the user who created them.
  • the full path of the directory for the shared reports and queries. This directory corresponds to the directory of the reports and queries visible by all the application users.
fResourceDirReturns the path of the read-only resources of the application.
fSaveBufferCreates and fills a text file with the content of a string or buffer variable.
fSaveTextCreates and fills a text file with the content of a text control or text variable (string variable, edit control in a window, Static control in a report, ...).
fSeekGets and sets current position in an external file.
fSelectOpens the Windows file picker.
fSelectDirOpens a directory picker.
fSepReturns the separator of directory according to the current platform ('\' or '/').
fSeparatorReturns a file path with normalized separators.
fShortNameReturns the short name of a file or directory.
fShortPathReturns the full short path of a file or directory.
fSizeReturns the size of a file (in bytes).
fSizeUncompressedReturns the size of a file before compression. When a file is decompressed by fUncompress, we recommend that you to compare the non-compressed size of file with the available disk space.
fSplitSplits a file into several files.
fStopCompressStops the operation used to compress or decompress a file.
fTempDirReturns the name of directory used to store the temporary files.
fTempFileReturns the name of a unique temporary file.
fTempPathReturns the name of directory used to store the temporary files.
fTimeReturns or modifies the different times associated with a file or directory (date created, modified or accessed).
fUncompressDecompresses a file that was compressed by fCompress.
fUnlockEntirely or partially unlocks an external file.
fWatchDirectoryDetects changes made to the contents of a directory.
fWatchFileStarts watching a file.
fWatchStopStops watching a file or directory.
fWatchStopAllStops all current watch tasks of files and directories.
fWebDirReturns the physical name of the directory containing the images, JavaScript files and Java files of the WEBDEV website.
fWriteWrites:
  • a character string to an external file.
  • a memory section.
fWriteLineWrites a line to a text file (ANSI or Unicode).
The following functions can also be used to manage the external files:
CompleteDirAdds a backslash to the end of a string, if necessary. This function is useful for building full file names when the path format is unknown (e.g., if the user types a file path).
UncompleteDirRemoves the "/" or "\" character from the end of a string, if necessary. This function is useful for building full file names when the path format is unknown (e.g., if the user types a file path).
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: 09/20/2024

Send a report | Local help