# %chmod() function

The %chmod() function changes the mode
of the file *str* to the value specified in *mode*.

**For Windows:** Not Supported

## Syntax

```
var = %chmod(str, mode)
```

## Description

The valid values for *mode* are in the include file: mode.h. Combinations of the
modes are obtained by adding several elementary mode values together.

## Example(s)

```
include dm,bp,unix.h mode.h
filename = "/tmp/myfile"
n=%chmod(filename,S$IRUSR+S$IWUSR+S$IRGRP+S$IWGRP)
```

## See also

- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [cfunction statement](https://d3codex.com/pickbasic-flashbasic/cfunction-statement/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [not() function](https://d3codex.com/pickbasic-flashbasic/not-function/)
- [rem() function](https://d3codex.com/pickbasic-flashbasic/rem-function/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [\= assignment operator](https://d3codex.com/pickbasic-flashbasic/backslash-equals-assignment-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/percent-chmod-function/ - part of the D3Codex reference.
