# %filecheck() function

The %filecheck() function can be run from the TCL to call the
 system fsck (file system check) command.

## Syntax

**For Linux and AIX:**Not Supported

```
 file.descriptor = %filecheck(arg, error_count)
```

## Parameter(s)

| file.descriptor | Specifies the return value of a previous call to the %open() function. |
| --- | --- |
| arg | Specifies whether or not errors should be corrected. 0 = Do not fix errors 2 = Fix errors |
| error_count | Specifies the output parameter. The error_count variable takes the address of a variable to place the number of errors encountered during the file check. |

## Example(s)

```

 fsidm,bp, FsiResize
 ...
 include dm,bp,includes nt_defs.inc
 ...
 *
 * Do file check
 * -------------
 ErrCnt = 0 ;* [1.7]
 RetCode = %FileCheck( FileDesc, FileChkOpt+0, &ErrCnt ) ;* [1.7]
 if RetCode # 0 then ;* [1.7]
 ...
```

## See also

- [%open() function](https://d3codex.com/pickbasic-flashbasic/percent-open-function/)
- [cfunction statement](https://d3codex.com/pickbasic-flashbasic/cfunction-statement/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [fsck command](https://d3codex.com/tcl/fsck-command/)

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