PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Notes
  • Operating mode in Windows Vista (and later)
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
fAttributeReadOnly (Function)
In french: fAttributLectureSeule
Specifies whether a text file is read-only and changes the read-only attribute of a file.
Java Only specifies whether a text file is read-only.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps 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.
Versions 24 and later
Windows This function is now available for the WEBDEV sites in Windows.
Linux This function is now available for WEBDEV sites in Linux.
New in version 24
Windows This function is now available for the WEBDEV sites in Windows.
Linux This function is now available for WEBDEV sites in Linux.
Windows This function is now available for the WEBDEV sites in Windows.
Linux This function is now available for WEBDEV sites in Linux.
Example
WINDEVJavaUser code (UMC)
IF fAttributeReadOnly("C:\temp\Test.doc") = True THEN
Trace("The C:\temp\Test.doc file is read-only")
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. The ErrorOccurred variable returns True if an error occurred.
<File name>: Character string (with quotes)
Name and full (or relative) path of file (up to 260 characters). A UNC path can be used.
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.
WINDEVUser 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.
    The ErrorOccurred variable returns True if an error occurred.
<File name>: Character string (with quotes)
Name and full (or relative) path of file (up to 260 characters). A UNC path can be used.
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.
<Change attribute>: Boolean
  • True to make the file read-only,
  • False otherwise.
Remarks

Notes

  • In Windows 98 or Me, this function may fail if a Unicode string is used for the <File name> parameter.
WINDEVJavaUser code (UMC)

Operating mode in Windows Vista (and later)

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