AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos
  • Handling errors
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Returns the size of a file (in bytes).
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)PHPAjax
// Size of a file
ResSize is int
ResSize = fSize("C:\MyDirectories\File.doc")
WINDEVWEBDEV - Código ServidorReportes y ConsultasJavaCódigo de Usuario (UMC)PHPAjax
// Open an external file
MyTextFile is DiskFile
ResSize is int
MyTextFile = fOpen("C:\MyDirectories\File.txt", foReadWrite)

// Size of a file
ResSize = fSize(MyTextFile)
Sintaxis
WINDEVWEBDEV - Código ServidorReportes y ConsultasAndroidWidget Android iPhone/iPadIOS WidgetMac CatalystJavaCódigo de Usuario (UMC)PHPAjax

Getting the size of a file according to its path Ocultar los detalles

<Result> = fSize(<File path>)
<Result>: Integer
  • File size in bytes,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File path>: Character string
Name and full or relative path of the file (up to 260 characters). A UNC path can be used. Wildcard characters (* and?) are not allowed.
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidWidget Android This parameter can correspond to a full path or a path relative 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 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 can correspond to a full path or a path relative to the current directory (returned by fCurrentDir). This parameter is case-sensitive.
Reminder Under iPhone/iPad, on both the device and the emulator, the file system is read-only. An application can only write to its installation directory or one of its subdirectories.
WINDEVWEBDEV - Código ServidorReportes y ConsultasiPhone/iPadIOS WidgetMac CatalystCódigo de Usuario (UMC)Ajax

Finding out the size of a file opened by the application Ocultar los detalles

<Result> = fSize(<File used>)
<Result>: Integer
  • File size in bytes,
  • -1 if an error occurred. To get more details on the error, use ErrorInfo with the errMessage constant.
When handling files exceeding 2 GB, <Result> must correspond to an 8-byte integer.
<File used>: Integer or DiskFile variable
Observaciones

Handling errors

fSize throws an error in the following cases:
  • the specified file does not exist,
  • the name of the specified file is invalid.
Note: fSize does not work on hidden files.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300std.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
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 06 2019

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local