MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / delete_file

Function delete_file

libcppcryptfs/util/fileutil.cpp:867–892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867bool delete_file(const CryptContext *con, const WCHAR *filename, bool cleanup_longname_file_only)
868{
869 if (!cleanup_longname_file_only && PathFileExists(filename)) {
870 if (!DeleteFile(filename))
871 return false;
872 }
873
874 if (!con->GetConfig()->m_PlaintextNames && con->GetConfig()->m_LongNames && is_long_name(filename)) {
875
876 wstring path = filename;
877
878 path += LONGNAME_SUFFIX_W;
879
880 if (PathFileExists(&path[0])) {
881 if (DeleteFile(&path[0]))
882 return true;
883 else
884 return false;
885 }
886
887 return true;
888 } else {
889 return true;
890 }
891
892}
893#endif // _WIN32
894
895

Callers 2

CryptMoveFileInternalFunction · 0.85

Calls 2

is_long_nameFunction · 0.85
GetConfigMethod · 0.80

Tested by

no test coverage detected