PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Managing errors
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
Returns the size of a directory in bytes.
Caution: The execution of this function may take quite a long time depending on the size of the directory to analyze.
Versions 15 and later
Android This function is now available for the Android applications.
WEBDEV - Server codePHP This function is now available for the PHP sites.
New in version 15
Android This function is now available for the Android applications.
WEBDEV - Server codePHP This function is now available for the PHP sites.
Android This function is now available for the Android applications.
WEBDEV - Server codePHP This function is now available for the PHP sites.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
WINDEVWEBDEV - Server codeReports and QueriesJavaAjaxUser code (UMC)
ResSize is int
// Size of "C:\MyDocuments" directory
ResSize = fDirSize("C:\MyDocuments")
// Readable display
Info("The size of the directory is: " + LengthToString(ResSize))
Windows Mobile
ResSize is int
// Size of "MyDocuments" directory
ResSize = fDirSize("\MyDocuments")
// Readable display
Info("The size of the directory is: " + LengthToString(ResSize))
Syntax
<Result> = fDirSize(<Directory Path> [, <Options>])
<Result>: Integer
  • Size of the directory in bytes,
  • -1 if an error or an interruption occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
Note: the hidden files are taken into account when calculating the size of the directory.
<Directory Path>: Character string
Name and full (or relative) path of the directory to use (up to 260 characters). A UNC path can be used. The wildcard characters (*,?) are not allowed.
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: 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).
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: 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).
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: 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).
Windows Mobile This path must be a full path or a UNC path. It cannot be a relative path.
Versions 17 and later
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: On iPhone/iPad, 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.
New in version 17
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: On iPhone/iPad, 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.
iPhone/iPad This parameter can correspond to a full path or to a relative path in relation to the current directory (returned by fCurrentDir). This parameter is case sensitive.
Reminder: On iPhone/iPad, 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.
<Options>: Integer constant or combination of constants (optional)
Type of browse performed for the directory files:
fdInterruptibleThe browse can be interrupted by pressing the ESC key. The function will return the name of directories listed until the interruption.
WEBDEV - Server codeLinuxWindows Mobile This constant has no effect.
frNotRecursiveThe browse is a non-recursive browse. The sub-directories are ignored.
frRecursive
(Default value)
The browse is a recursive browse. The sub-directories are automatically taken into account.
fdIgnoreErrorIf a directory cannot be browsed, it is ignored. If this constant is not specified, fDirSize returns an error.
Remarks

Managing errors

fDirSize generates an error in the following cases:
  • the specified directory does not exist,
  • the name of the directory is invalid,
  • the operation was interrupted by the user.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 12
This page is also available for…
Comments
Exemplo fDirSize/LengthToString
Exemplo fDirSize/LengthToString

s_diretorio is string="E:\_clientes_atualizacoes\_Windev_Erp_Matos\"
n_tamanho_diretorio is int=fDirSize(s_diretorio)
EDT_texto=LengthToString(n_tamanho_diretorio,sizeB)+CR
EDT_texto+=LengthToString(n_tamanho_diretorio,sizeGB)+CR
EDT_texto+=LengthToString(n_tamanho_diretorio,sizeKB)+CR
EDT_texto+=LengthToString(n_tamanho_diretorio,sizeMB)+CR
EDT_texto+=LengthToString(n_tamanho_diretorio,sizeTB)+CR

//Blog com video e exemplo:
http://windevdesenvolvimento.blogspot.com.br/2016/09/curso-windev-arquivos-010-arquivos.html
https://www.youtube.com/watch?v=5PFR3pfXC2w
De matos AMARILDO
Sep. 02 2016