fs/io/FileOutputStream: decouple from the FileSystem library
This commit is contained in:
parent
6a95c34a81
commit
196ce8426b
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "FileOutputStream.hxx"
|
#include "FileOutputStream.hxx"
|
||||||
#include "fs/FileSystem.hxx"
|
|
||||||
#include "system/Error.hxx"
|
#include "system/Error.hxx"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
@ -77,10 +76,7 @@ FileOutputStream::Cancel()
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
try {
|
DeleteFile(GetPath().c_str());
|
||||||
RemoveFile(GetPath());
|
|
||||||
} catch (std::runtime_error) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -157,10 +153,7 @@ FileOutputStream::Commit()
|
||||||
|
|
||||||
#if HAVE_LINKAT
|
#if HAVE_LINKAT
|
||||||
if (is_tmpfile) {
|
if (is_tmpfile) {
|
||||||
try {
|
unlink(GetPath().c_str());
|
||||||
RemoveFile(GetPath());
|
|
||||||
} catch (std::runtime_error) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/* hard-link the temporary file to the final path */
|
/* hard-link the temporary file to the final path */
|
||||||
char fd_path[64];
|
char fd_path[64];
|
||||||
|
@ -193,10 +186,7 @@ FileOutputStream::Cancel()
|
||||||
#ifdef HAVE_LINKAT
|
#ifdef HAVE_LINKAT
|
||||||
if (!is_tmpfile)
|
if (!is_tmpfile)
|
||||||
#endif
|
#endif
|
||||||
try {
|
unlink(GetPath().c_str());
|
||||||
RemoveFile(GetPath());
|
|
||||||
} catch (std::runtime_error) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue