| 552 | } |
| 553 | |
| 554 | File::Ptr Directory::make_new_file(const ACE_TString& t_name) |
| 555 | { |
| 556 | if (dirs_.find(t_name) != dirs_.end()) { |
| 557 | throw std::runtime_error("Can't create a file with the same name as " |
| 558 | "an existing directory."); |
| 559 | } |
| 560 | |
| 561 | ACE_TString phys = add_entry() + b32h_encode(t_name.c_str()); |
| 562 | files_[t_name] = phys; |
| 563 | |
| 564 | CwdGuard cg(physical_dirname_); |
| 565 | // touch the file since the user has asked to create it |
| 566 | std::FILE* fh = std::fopen(ACE_TEXT_ALWAYS_CHAR(phys.c_str()), "w"); |
| 567 | |
| 568 | if (!fh) throw std::runtime_error("Can't create the file"); |
| 569 | |
| 570 | std::fclose(fh); |
| 571 | return DCPS::make_rch<File>(physical_dirname_ + phys, t_name, rchandle_from(this)); |
| 572 | } |
| 573 | |
| 574 | File::Ptr Directory::create_next_file() |
| 575 | { |
nothing calls this directly
no test coverage detected