PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Managing the 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 file (in bytes).
WEBDEV - Server codePHPAjax
// Size of a file
ResSize = fSize("C:\MyDirectories\File.doc")
Syntax
WEBDEV - Server codePHPAjax

Finding out the size of a file according to its path Hide the details

<Result> = fSize(<File path>)
<Result>: Integer
  • Size of the file (in bytes),
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File path>: Character string (with quotes)
Name and full (or relative) path of file (up to 260 characters). A UNC path can be used. The wildcard characters (* and?) are not allowed.
Versions 15 and later
WindowsLinux This parameter can be in Ansi or Unicode format.
New in version 15
WindowsLinux This parameter can be in Ansi or Unicode format.
WindowsLinux This parameter can be in Ansi or Unicode format.
Versions 15 and later
WEBDEV - Server codeAjax

Finding out the size of a file opened by the application Hide the details

<Result> = fSize(<File identifier>)
<Result>: Integer
  • Size of the file (in bytes),
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File identifier>: Integer
Identifier of the file returned by one of the following functions: fOpen, fCreate, fOpenTempFile, fMemOpen.
New in version 15
WEBDEV - Server codeAjax

Finding out the size of a file opened by the application Hide the details

<Result> = fSize(<File identifier>)
<Result>: Integer
  • Size of the file (in bytes),
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File identifier>: Integer
Identifier of the file returned by one of the following functions: fOpen, fCreate, fOpenTempFile, fMemOpen.
WEBDEV - Server codeAjax

Finding out the size of a file opened by the application Hide the details

<Result> = fSize(<File identifier>)
<Result>: Integer
  • Size of the file (in bytes),
  • -1 if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File identifier>: Integer
Identifier of the file returned by one of the following functions: fOpen, fCreate, fOpenTempFile, fMemOpen.
Remarks

Managing the errors

fSize generates an error in the following cases:
  • the specified file does not exist,
  • the name of the specified file is invalid.
Note: fSize does not operate on the hidden files.
Component : wd240std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video fSize
https://youtu.be/HyN7Hq54yIw

https://windevdesenvolvimento.blogspot.com/2019/06/dicas-2171-windev-webdev-mobile-arquivo.html

// BTN_TAMANHO_ARQUIVO

n_tamanho_arquivo is int=fSize(EDT_ARQUIVO)
EDT_RESPOSTA=LengthToString(n_tamanho_arquivo,sizeB)+CR
EDT_RESPOSTA+=LengthToString(n_tamanho_arquivo,sizeGB)+CR
EDT_RESPOSTA+=LengthToString(n_tamanho_arquivo,sizeKB)+CR
EDT_RESPOSTA+=LengthToString(n_tamanho_arquivo,sizeMB)+CR
EDT_RESPOSTA+=LengthToString(n_tamanho_arquivo,sizeTB)+CR
amarildo
28 Jun. 2019