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
Creates an external file. This file is automatically opened in read/write.
Remarks:
Ejemplo
Sintaxis

Crear un archivo externo y asociarlo a una variable DiskFile Ocultar los detalles

<Result> = <DiskFile>.Create(<File path> [, <Creation options>])
<Result>: booleano
  • True if the file was opened and associated with variable of type DiskFile,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<DiskFile>: Variable de tipo DiskFile
Name of the DiskFile variable to be associated with the manipulated text file.
<File path>: Cadena de caracteres
Name and full or relative path of the file (up to 260 characters). The extension of the file can be specified. By default, if the file extension is not specified, the external file will have no extension. A UNC path can be used.
Note: If the external file already exists (same directory and same name), this file is deleted and recreated. To avoid deleting an existing file, use <DiskFile variable>Abrir associated with the foCreateIfNotFound constant.
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 Under Android, an application can only write to its installation directory or one of its sub-directories, as well as to 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: On iPhone or iPad, an application has the rights to write to its installation directory or one of its subdirectories
<Creation options>: Combinación de constantes opcionales
Options for creating the file:
  • Blocking options: A block can be set when the external file is opened:
    foAutomaticDeletionThe file is locked when opened, and will be automatically deleted when closed (when <DiskFile variable>Cerrar is called, or when the application is closed).
    If multiple applications are using the file, it will be automatically deleted when the last application closes it (when <DiskFile variable>Cerrar is called, or at the end of the application).
    foReadLockThe file will be created in read-only. The other applications that use this file will not be able to read it.
    foWriteLockThe file will be created in write-only. The other applications that use this file will not be able to modify it.

    AndroidWidget Android iPhone/iPadIOS WidgetMac Catalyst The lock options are not available. The external file can be freely accessed by the other applications.
  • Type of external file to create. This type is used by <DiskFile variable>.ReadLine and <DiskFile variable>WriteLine to define the type of information to read and write in the external file:
    foAnsiAnsi file. This constant is used to manage an Ansi file when the "Use Unicode strings at runtime" mode is enabled in the project configuration.
    This mode is used by default in the WINDEV and WEBDEV projects.
    foUnicodeUnicode file. This constant is used to manage a Unicode file when the "Use Ansi strings at runtime" mode is enabled in the project configuration.
    This mode is used by default in WINDEV Mobile projects.

    iPhone/iPadIOS WidgetMac Catalyst The type of the file to be created is not available. The type of the file corresponds to the default mode.

By default, if no constant is specified:
  • the external file can be freely accessed by the other applications,
  • the type of the file corresponds to the default mode.
Observaciones

Handling errors

<DiskFile variable>.Create throws an error in the following cases:
  • the file is locked by another computer or by another application,
  • the user has no write rights in the creation directory.
  • a Unicode string was used for <File path> in an operating system such as Windows 98 or Windows Me.
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300std.dll
Versión mínima requerida
  • Versión 28
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

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