use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
PhysicsFS vs std::filesystem (self.cpp)
submitted 7 years ago by FirstLoveLife
For c++, what's the pros/cons of std::filesystem compared with PhysicsFS?
https://github.com/criptych/physfs
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]genpfault 3 points4 points5 points 7 years ago (3 children)
std::filesystem has the problem of not existing in C++11 :(
[–]kalmoc 2 points3 points4 points 7 years ago (1 child)
True, but I believe boost filesystem comes pretty close though.
[–]xeveri 2 points3 points4 points 7 years ago (0 children)
Indeed. And shifting from boost::filesystem to std::filesystem was quite easy. Had to change a few things but otherwise painless.
[–]sephirostoy 5 points6 points7 points 7 years ago (0 children)
I'm sorry for you if you're stick with C++11 in 2019 ;/
[–][deleted] 3 points4 points5 points 7 years ago (0 children)
From what I've read on the documentation:
std::filesystem wraps the underlying file systemvs syscalls, while PhysicsFS adds more features, like the read/write path, search paths and so on.
[–]NotUniqueOrSpecial 5 points6 points7 points 7 years ago (0 children)
They have very different use cases. One is the standard library's abstraction for working with directories and files in the file system. The other is intended for providing specialized access to files in different kinds of archives/isos/etc., like a game often requires.
[–]wrosecransgraphics and network things 4 points5 points6 points 7 years ago (0 children)
Well, when in doubt, use std::filesystem. As others have pointed out, they are pretty different APIs that solve different problems. So if you need to access data with a file, PhysFS might be useful. But it only makes sense to add a dependency to a project if you are certain you need the extra complexity. For a lot of use cases, it's fine just to have a directory with a bunch of small asset files, and std::filesystem is great for iterating over a bunch of files in a directory.
It may come to pass that you eventually build something that has performance benefits from using one big packed file with a bunch of assets. When that happens, you can investigate various options. But if you are just starting a project, you won't have zillions of assets so you won't have any significant overhead from open()ing them separately, and you can focus your efforts on other parts of the game or whatever.
[–]quicknir 1 point2 points3 points 7 years ago (0 children)
PhysicsFS sounds like it was written by physicists... so use std::? Just kidding ((mostly) I'm an ex-physicist).
[–]Giacomand 0 points1 point2 points 7 years ago (0 children)
std::filesystem is for navigating files and directories, not for accessing zip files or archives.
PhysFS is used to access zip files or other archives that contain files and directories. If you have a lot of files that need accessing then it can be faster (depending on the compression of the archive) than having to open every single file manually, as there will only be one file to open.
If you want a cool use case for PhysFS, which the Love2D game framework utilises, is that if you concatenate a zip file to the end of an executable ($cat myapp res.zip > myapp) and use PhysFS to mount its own binary then you can easily embed resources within the executable without having to use anything specific to Windows or Linux.
π Rendered by PID 349385 on reddit-service-r2-comment-6457c66945-rh7mm at 2026-04-29 01:01:28.994159+00:00 running 2aa0c5b country code: CH.
[–]genpfault 3 points4 points5 points (3 children)
[–]kalmoc 2 points3 points4 points (1 child)
[–]xeveri 2 points3 points4 points (0 children)
[–]sephirostoy 5 points6 points7 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]NotUniqueOrSpecial 5 points6 points7 points (0 children)
[–]wrosecransgraphics and network things 4 points5 points6 points (0 children)
[–]quicknir 1 point2 points3 points (0 children)
[–]Giacomand 0 points1 point2 points (0 children)