MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / main

Function main

test/WriteFile.cxx:35–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35int
36main(int argc, char **argv)
37try {
38 if (argc != 2) {
39 fprintf(stderr, "Usage: WriteFile PATH\n");
40 return EXIT_FAILURE;
41 }
42
43 const FromNarrowPath path = argv[1];
44
45 FileOutputStream fos(path);
46
47 if (!Copy(fos, STDIN_FILENO))
48 return EXIT_FAILURE;
49
50 fos.Commit();
51
52 return EXIT_SUCCESS;
53} catch (...) {
54 PrintException(std::current_exception());
55 return EXIT_FAILURE;
56}

Callers

nothing calls this directly

Calls 3

PrintExceptionFunction · 0.85
CopyFunction · 0.70
CommitMethod · 0.45

Tested by

no test coverage detected