PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
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
Creates and opens a temporary file. A unique name is given by the system to each temporary file.
Versions 15 and later
WEBDEV - Server codePHP This function is now available for the PHP sites.
New in version 15
WEBDEV - Server codePHP This function is now available for the PHP sites.
WEBDEV - Server codePHP This function is now available for the PHP sites.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaPHPAjaxUser code (UMC)
// Retrieve the identifier of the temporary file
ResUniqueTempFile = fOpenTempFile(foAutomaticDeletion, "ABC", "C:\MyDirectories")
IF ResUniqueTempFile = -1 THEN
Error(ErrorInfo())
ELSE
fWriteLine(ResUniqueTempfile, "Status report of " + DateSys())
...
END
Windows Mobile
// Retrieve the identifier of the temporary file
ResUniqueTempFile = fOpenTempFile(foWithoutDeletion, "ABC", "C:\MyDirectories")
IF ResUniqueTempFile = -1 THEN
Error(ErrorInfo())
ELSE
fWriteLine(ResUniqueTempfile, "Status report of " + DateSys())
...
END
Syntax
<Result> = fOpenTempFile([<Opening Mode> [, <Prefix of Temporary File> [, <Directory of Temporary File>]]])
<Result>: Integer
  • Identifier of the temporary file. This identifier will be used by all the functions for handling the external files.
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
<Opening Mode>: Optional constant (or combination of constants)
Constants used to define the opening mode of the file, the access mode to the file and the lock mode of the file.
  • Lock mode of the file and opening mode of the file:
    foWriteLockThe other applications cannot modify the current file.

    LinuxWindows MobileJavaPHP This constant is not available.
    foReadLockThe other applications cannot read the current file.

    LinuxWindows MobileJavaPHP This constant is not available.
    foWithoutDeletionThe file will not be automatically deleted when it is closed.
    LinuxWindows Mobile Default value.
    foAutomaticDeletionThe file is locked when it is opened and it will be automatically deleted when it is closed (call to fClose or at the end of the application).
    If the file was opened by another application, it will be automatically deleted by the system when all the applications have closed the file.

    WINDEV Default value.
    LinuxWindows Mobile This constant is not available.
    Java If the file is used by another application when it is closed (call to fClose or at the end of the application), it will not be deleted.
  • Access mode to the file. This type is used by fReadLine and fWriteLine to define the type of information to read and write in the external file:
    Versions 17 and later
    foAnsi
    New in version 17
    foAnsi
    foAnsi
    Ansi file. This constant is used to manage an Ansi file when the "Use the Unicode strings at run time" mode is enabled in the project configuration.
    Mode used by default:
    • in the WINDEV and WEBDEV projects earlier than version 17.
    • in the configurations of WINDEV and WEBDEV projects that use the "Use the Ansi strings at run time" mode from version 17.
    foUnicodeUnicode file. This constant is used to manage a Unicode file when the "Use the Ansi strings at run time" mode is enabled in the project configuration.
    Mode used by default:
    • in the WINDEV Mobile projects regardless of the mode and version used.
    • in the configurations of WINDEV and WEBDEV projects that use the "Use the Unicode strings at run time" mode from version 17.
    JavaPHP This constant is not available.
<Prefix of Temporary File>: Optional character string (with quotes)
Prefix (3 letters) for the name of the temporary file. This parameter is used to prefix the name of the temporary file. Only the first three letters will be taken into account.
Versions 15 and later
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
<Directory of Temporary File>: Optional character string (with quotes)
Full or relative directory of the temporary file (up to 260 characters). A UNC path can be used. This directory name may (or may not) end with the "\" character. This directory must exist. Otherwise, a WLanguage error occurs.
If this parameter is not specified, the default directory will be:
  • the temporary directory of Windows (if this directory exists on the current computer),
  • the current directory (if the temporary directory of Windows does not exist on the current computer).
Versions 15 and later
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
WindowsLinuxPHP This parameter can be in Ansi or Unicode format.
Windows Mobile Full directory of temporary file (up to 260 characters). This directory name may (or may not) end with the "\" character. This directory must exist. Otherwise, a WLanguage error occurs. If this parameter is not specified, the default directory will be the temporary directory of Windows.
Remarks
fOpenTempFile generates an error in the following cases:
  • the specified directory does not exist,
  • the file is locked by another computer or by another application,
  • the user has no read or write rights on the file to open.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Linux wd230std.so
Windows Mobile wp230std.dll
Java wd230java.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment