+ * Owns the file descriptor implicitly.
+ */
+ explicit File(const char* name, int flags = O_RDONLY, mode_t mode = 0666);
+ explicit File(
+ const std::string& name, int flags = O_RDONLY, mode_t mode = 0666);
+ explicit File(StringPiece name, int flags = O_RDONLY, mode_t mode = 0666);
+
+ /**
+ * All the constructors that are not noexcept can throw std::system_error.
+ * This is a helper method to use folly::Expected to chain a file open event
+ * to something else you want to do with the open fd.