ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / External file functions
  • Notes
  • Operating mode in Windows Vista (and later)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
fAttributeReadOnly (Function)
In french: fAttributLectureSeule
Gets and sets the read-only attribute of a file.
AndroidAndroid Widget Java Only indicates if a file is read-only
Example
WINDEVReports and QueriesJavaUser code (UMC)
IF fAttributeReadOnly("C:\temp\Test.doc") = True THEN
	Trace("Le fichier C:\temp\Test.doc est en lecture seule")
END
Syntax

Finding out whether a file is read-only Hide the details

<Result> = fAttributeReadOnly(<File name>)
<Result>: Boolean
  • True if the file is read-only,
  • False otherwise. On error, variable ErrorOccurred returns True.
<File name>: Character string
Name and full or relative path of the file (up to 260 characters). A UNC path can be used.
WindowsLinux This parameter can be in Ansi or Unicode format.
AndroidAndroid Widget 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: In iOS/iPadOS, 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.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadIOS WidgetMac CatalystUser code (UMC)

Making a file read-only Hide the details

<Result> = fAttributeReadOnly(<File name> , <Change attribute>)
<Result>: Boolean
Previous status of the file:
  • True if the file was read-only,
  • False otherwise.
    On error, variable ErrorOccurred returns True.
<File name>: Character string
Name and full or relative path of the file (up to 260 characters). A UNC path can be used.
WindowsLinux This parameter can be in Ansi or Unicode format.
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: In iOS/iPadOS, 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.
<Change attribute>: Boolean
  • True to make the file read-only,
  • False otherwise.
Remarks

Notes

This function is faster than fAttribute.
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)

Operating mode in Windows Vista (and later)

If this function does not work 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).
In Windows Vista (and later), with the UAC mechanism (User Account Control) enabled, you must have administrator privileges to handle and/or modify the files or directories in system directories (Windows directory or "Program Files" directory).
Programming tip: If you need to manipulate / modify files or directories, without needing administrator privileges, it is advisable:
  • avoid writing to the Windows directory or to the "Program Files" directory,
  • use the system directory of the application (returned by SysDir with the srAppDataCommun constant, for example).
Component: wd300std.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/15/2025

Send a report | Local help