MCPcopy Create free account
hub / github.com/boostorg/leaf / file_open

Function file_open

example/print_file/print_file_exceptions.cpp:160–166  ·  view source on GitHub ↗

Open a file for reading.

Source from the content-addressed store, hash-verified

158
159// Open a file for reading.
160std::shared_ptr<FILE> file_open( char const * file_name )
161{
162 if( FILE * f = fopen(file_name, "rb") )
163 return std::shared_ptr<FILE>(f, &fclose);
164 else
165 leaf::throw_exception(open_error, leaf::e_errno{errno});
166}
167
168
169// Return the size of the file.

Callers 1

mainFunction · 0.70

Calls 1

throw_exceptionFunction · 0.70

Tested by

no test coverage detected