file is not a reference, setting it is not relevant. You can just do 
```
isCurrentlyRedirecting = (freopen(fileName.c_str(), "a", file));
```
And then issue the root if that Boolean is false.