# %freopen() function

The %freopen() function substitutes
the named file specified by *str* in place of the
opened stream *stream1*.

## Syntax

```
stream = (char*)%freopen(str, type, (char*)stream1)
```

## Description

The stream is returned as a
pointer to a character or 0 if an error has occurred. system(0) is then set to the error number.

## See also

- [%fclose() function](https://d3codex.com/pickbasic-flashbasic/percent-fclose-function/)
- [%fdopen() function](https://d3codex.com/pickbasic-flashbasic/percent-fdopen-function/)
- [%fopen() function](https://d3codex.com/pickbasic-flashbasic/percent-fopen-function/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [cfunction statement](https://d3codex.com/pickbasic-flashbasic/cfunction-statement/)

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