output.cc (5402:05c388940eb6) | output.cc (5524:e5fbd38bc828) |
---|---|
1/* 2 * Copyright (c) 2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 46 unchanged lines hidden (view full) --- 55void 56OutputDirectory::setDirectory(const string &d) 57{ 58 if (!dir.empty()) 59 panic("Output directory already set!\n"); 60 61 dir = d; 62 | 1/* 2 * Copyright (c) 2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 46 unchanged lines hidden (view full) --- 55void 56OutputDirectory::setDirectory(const string &d) 57{ 58 if (!dir.empty()) 59 panic("Output directory already set!\n"); 60 61 dir = d; 62 |
63 if (dir != ".") { 64 if (mkdir(dir.c_str(), 0777) < 0 && errno != EEXIST) 65 panic("couldn't make output dir %s: %s\n", 66 dir, strerror(errno)); 67 } 68 | |
69 // guarantee that directory ends with a '/' 70 if (dir[dir.size() - 1] != '/') 71 dir += "/"; 72} 73 74const string & 75OutputDirectory::directory() 76{ --- 56 unchanged lines hidden --- | 63 // guarantee that directory ends with a '/' 64 if (dir[dir.size() - 1] != '/') 65 dir += "/"; 66} 67 68const string & 69OutputDirectory::directory() 70{ --- 56 unchanged lines hidden --- |