PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Error management
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Renames a directory.
Example
// Modification du nom d'un répertoire
IF NOT fDirRename("C:\Répertoire", "C:\RépertoireRenommé") THEN
ErrorInfo(errMessage)
END
Syntax
<Result> = fDirRename(<Directory to rename> , <New directory name>)
<Result>: Boolean
  • True if the modification was performed,
  • False otherwise. To find out the name of the error, use the function ErrorInfo with the constant errMessage.
<Directory to rename>: Character string (with quotes)
  • 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.
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 setup directory or one of its subdirectories, as well as to the external memory (SDCard).
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
iPhone/iPad This parameter is case-sensitive.
Reminder: On iPhone/iPad, an application has the rights to write into its setup directory or into one of its subdirectories.
<New directory name>: Character string (with quotes)
New directory name (the full path of the directory with the new name must not exceed 260 characters).
Wildcard characters are not allowed.
iPhone/iPad This parameter is case-sensitive.
Remarks

Error management

fDirRename generates 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.
User 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).
Indeed, in Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have the administrator privileges to handle and/or modify the files or directories in the 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 into the Windows directory or into the "Program Files" directory,
  • use the system directory corresponding to the application (returned by SysDir associated with the srCommonAppData constant).
Component: wd260std.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment