---
url: /flow/guide/scripting-reference/functions/file/filelocked.md
---

# FileLocked

## Declaration

`Function FileLocked( aFilePath : string) : boolean`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  if FileLocked(Source.FileCon.CurrentFilename) then
LogWarning('The file is locked');
end;
```

## Description

Returns True if the file is locked. This indicates whether another program is accessing the file in a manner that does not allow sharing.
