|
a/src/utils/pathut.cpp |
|
b/src/utils/pathut.cpp |
|
... |
|
... |
146 |
|
146 |
|
147 |
return true;
|
147 |
return true;
|
148 |
}
|
148 |
}
|
149 |
|
149 |
|
150 |
TempFileInternal::TempFileInternal(const string& suffix)
|
150 |
TempFileInternal::TempFileInternal(const string& suffix)
|
|
|
151 |
: m_noremove(false)
|
151 |
{
|
152 |
{
|
152 |
string filename = path_cat(tmplocation(), "rcltmpfXXXXXX");
|
153 |
string filename = path_cat(tmplocation(), "rcltmpfXXXXXX");
|
153 |
char *cp = strdup(filename.c_str());
|
154 |
char *cp = strdup(filename.c_str());
|
154 |
if (!cp) {
|
155 |
if (!cp) {
|
155 |
m_reason = "Out of memory (for file name !)\n";
|
156 |
m_reason = "Out of memory (for file name !)\n";
|
|
... |
|
... |
177 |
}
|
178 |
}
|
178 |
}
|
179 |
}
|
179 |
|
180 |
|
180 |
TempFileInternal::~TempFileInternal()
|
181 |
TempFileInternal::~TempFileInternal()
|
181 |
{
|
182 |
{
|
182 |
if (!m_filename.empty())
|
183 |
if (!m_filename.empty() && !m_noremove)
|
183 |
unlink(m_filename.c_str());
|
184 |
unlink(m_filename.c_str());
|
184 |
}
|
185 |
}
|
185 |
|
186 |
|
186 |
TempDir::TempDir()
|
187 |
TempDir::TempDir()
|
187 |
{
|
188 |
{
|