• Advertisement
Sign in to follow this  

C++ fstream-File works without extension?

This topic is 2117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was playing around with C++ file i/o today and couldn't seem to get it to work. I renamed my file from "example.txt" to just "example" and it worked(I still loaded it using .Open("example.txt") though in my program). Why is this? I would like to include the extention in my file name(specifically a custom name such as "example.custom", but it would still be a .txt file).

Share this post


Link to post
Share on other sites
Advertisement
You don't have file extensions visible in explorer. Thus the filename you entered was "example.txt.txt" Edited by Washu

Share this post


Link to post
Share on other sites
Posted · Hidden
Hidden
Can you post the code you used for this? Also, are you sure you're not looking in a different directory than the one you put the renamed file in?

Share this post


Link to post

You don't have file extensions visible in explorer. Thus the filename you entered was "example.txt.txt"


Thanks for the quick reply. I found someone else who had the same problem on google but I didn't have enough time to delete the thread. You're just too quick I guess ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement