Trying to implement file-like api