I am pretty sure you can't do this here - there is no guaranteed that the implementation of an IFile is a CFile - it could be a remote file or even a file within a zip file/git repository.