ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Handling errors
  • Operating mode in Windows Vista (and later)
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
Renames a directory.
Example
// Rename a directory
IF NOT fDirRename("C:\Directory", "RenamedDirectory") THEN
ErrorInfo(errMessage)
END
Syntax
<Result> = fDirRename(<Directory to rename> , <New directory name>)
<Result>: Boolean
  • True if the modification was performed,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Directory to rename>: Character string
  • Full path of the directory to rename (up to 260 characters). A UNC path can be used.
  • Path relative to the current directory (returned by fCurrentDir)
Wildcard characters are not allowed.
CAUTION: The directory to rename must not be the current application directory.
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter is case-sensitive.
Reminder: In Android, the file system is read-only on the device and on the emulator. An application can only write to its installation directory or one of its subdirectories, as well as to the external memory (SDCard).
iPhone/iPadIOS WidgetMac Catalyst This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its installation directory or into one of its subdirectories.
<New directory name>: Character string
New directory name (the full path of the directory with the new name must not exceed 260 characters). This name must not contain the disk name.
Wildcard characters are not allowed.
WindowsLinux This parameter can be in Ansi or Unicode format.
iPhone/iPadIOS WidgetMac Catalyst This parameter is case-sensitive.
Remarks

Handling errors

fDirRename throws an error in the following cases:
  • the directory to rename does not exist,
  • the directory to rename is blocked (e.g., one of its files is open),
  • the path of the directory to rename is invalid,
  • <New directory name> or <Directory to rename> is an empty string,
  • the new directory already exists.
Remark: This function can be used on an empty directory.
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not operate properly in Windows Vista (and later), check whether the file or directory used is not in one of the system directories (Windows directory or "Program Files" directory).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: To handle and/or modify the files or directories without administrator privileges, you should:
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
Component: wd290std.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/09/2024

Send a report | Local help