13 #include "file-path.hh"
19 open_file_stream (String filename, std::ios_base::openmode mode)
22 open_file_stream (String filename, int mode)
26 if ((filename == "-"))
30 Path p = split_path (filename);
31 if (!p.dir.empty_b ())
32 if (mkdir (p.dir.ch_C (), 0777) == -1 && errno != EEXIST)
33 error (_f ("can't create directory: `%s'", p.dir));
34 os = new ofstream (filename.ch_C (), mode);
37 error (_f ("can't open file: `%s'", filename));
42 close_file_stream (ostream *os)
47 warning (_ ("Error syncing file (disk full?)"));
48 exit_status_global = 1;