For example in FilePath.cpp:
TString FilePath::FixPathForPlatform(const TString FileName) {
TString result = FileName;
size_t position = result(_T("\\?\""));
if (position == TString::npos) {
result = TString(_T("\\?\"")) + result;
}
return result;
}
bool FilePath::DeleteFile(const TString FileName) {
bool result = false;
if (FileExists(FileName) == true) {
#ifdef WINDOWS
// To extend to long filenames prepend \\?\" to the filename.
TString lFileName = FixPathForPlatform (FileName);
FileAttributes attributes(lFileName);
if (attributes.Contains(faReadOnly) == true) {
attributes.Remove(faReadOnly);
}
result = ::DeleteFile(lFileName.data()) == TRUE;
#endif //WINDOWS
#ifdef POSIX
if (unlink(StringToFileSystemString(FileName)) == 0) {
result = true;
}
#endif //POSIX
}
return result;
}
TString FilePath::FixPathForPlatform(const TString FileName) {
TString result = FileName;
size_t position = result(_T("\\?\""));
if (position == TString::npos) {
result = TString(_T("\\?\"")) + result;
}
return result;
}
bool FilePath::DeleteFile(const TString FileName) {
bool result = false;
if (FileExists(FileName) == true) {
#ifdef WINDOWS
// To extend to long filenames prepend \\?\" to the filename.
TString lFileName = FixPathForPlatform (FileName);
FileAttributes attributes(lFileName);
if (attributes.Contains(faReadOnly) == true) {
attributes.Remove(faReadOnly);
}
result = ::DeleteFile(lFileName.data()) == TRUE;
#endif //WINDOWS
#ifdef POSIX
if (unlink(StringToFileSystemString(FileName)) == 0) {
result = true;
}
#endif //POSIX
}
return result;
}