1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Define FileNames::HardLinkeFile, but nonfunctional on Windows

This commit is contained in:
Paul Licameli 2018-10-13 13:18:17 -04:00
parent 04b5054ad1
commit cbe0ea84c1
2 changed files with 19 additions and 0 deletions

View File

@ -69,6 +69,20 @@ bool FileNames::CopyFile(
#endif #endif
} }
bool FileNames::HardLinkFile( const wxString& file1, const wxString& file2 )
{
#ifdef __WXMSW__
// return ::CreateHardLinkA( file1.c_str(), file2.c_str(), NULL );
return false;
#else
return 0 == ::link( file1.c_str(), file2.c_str() );
#endif
}
wxString FileNames::MkDir(const wxString &Str) wxString FileNames::MkDir(const wxString &Str)
{ {
// Behaviour of wxFileName::DirExists() and wxFileName::MkDir() has // Behaviour of wxFileName::DirExists() and wxFileName::MkDir() has

View File

@ -27,6 +27,11 @@ public:
static bool CopyFile( static bool CopyFile(
const wxString& file1, const wxString& file2, bool overwrite = true); const wxString& file1, const wxString& file2, bool overwrite = true);
// wxWidgets doesn't have a function to do this: make a hard file-system
// link if possible. It might not be, as when the paths are on different
// storage devices.
static bool HardLinkFile( const wxString& file1, const wxString& file2);
static wxString MkDir(const wxString &Str); static wxString MkDir(const wxString &Str);
static wxString TempDir(); static wxString TempDir();