MCPcopy Create free account
hub / github.com/PDAL/PDAL / createFile

Function createFile

pdal/PDALUtils.cpp:285–310  ·  view source on GitHub ↗

Create a file (may be on a supported remote filesystem). \param path Path to file to create. \param asBinary Whether the file should be written in binary mode. \return Pointer to the created stream, or NULL. */

Source from the content-addressed store, hash-verified

283 \return Pointer to the created stream, or NULL.
284*/
285std::ostream *createFile(const std::string& path, bool asBinary)
286{
287 ostream *ofs(nullptr);
288
289 if (isRemote(path))
290 {
291 arbiter::Arbiter a;
292 if (!a.hasDriver(path))
293 return ofs;
294 try
295 {
296 ofs = new ArbiterOutStream(tempFilename(path), path,
297 asBinary ? ios::out | ios::binary : ios::out);
298 }
299 catch (arbiter::ArbiterError&)
300 {}
301 if (ofs && !ofs->good())
302 {
303 delete ofs;
304 ofs = nullptr;
305 }
306 }
307 else
308 ofs = FileUtils::createFile(path, asBinary);
309 return ofs;
310}
311
312
313/**

Callers 15

LogMethod · 0.70
writePipelineFunction · 0.70
unwrapMethod · 0.50
writeMethod · 0.50
writeMethod · 0.50
readyMethod · 0.50
doneFileMethod · 0.50
readyFileMethod · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50

Calls 2

isRemoteFunction · 0.85
tempFilenameFunction · 0.85

Tested by 5

TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
runOgrWriterInfoFunction · 0.40