Files.IsReadOnly
----------------

Queries read only flag for a file or folder.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [12.5](newinversion125.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "Files.IsReadOnly"; Path ) 

**MBS**( **"Files.IsReadOnly";** /\* Queries read only flag for a file or folder. \*/  
**$Path**) /\* The native path to the file or folder to be checked.e.g. "C:\\Users\\Christian\\Desktop\\test.txt" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The native path to the file or folder to be checked. | "C:\\Users\\Christian\\Desktop\\test.txt" |

### Result

Returns 1, 0 or error.

### Description

Queries read only flag for a file or folder.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Check whether file is readonly:

 Set Variable \[$r ; Value: MBS ( "Files.IsReadOnly"; "C:\\Users\\Christian\\Desktop\\test.txt" ) \]  
### See also

- [Files.SetReadOnly](FilesSetReadOnly.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 12.5**
    - Added [Files.IsReadOnly](https://www.mbsplugins.eu/FilesIsReadOnly.shtml) and [Files.SetReadOnly](https://www.mbsplugins.eu/FilesSetReadOnly.shtml) functions for Windows.

### Blog Entries

- [MBS Plugin Advent calendar: 12 - Files](https://www.mbsplugins.de/archive/2023-12-12/MBS_Plugin_Advent_calendar_12_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.5 News](https://www.mbsplugins.de/archive/2022-11-17/MBS_FileMaker_Plugin_125_News/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.5pr1](https://www.mbsplugins.de/archive/2022-09-29/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 11st September 2022 , last changed 12nd February 2025

  
[Files.IsPackage](FilesIsPackage.md) - [Files.IsSystemImmutable](FilesIsSystemImmutable.md)

[HTML Version](FilesIsReadOnly.shtml)