本文整理汇总了C++中RemoveFile函数的典型用法代码示例。如果您正苦于以下问题:C++ RemoveFile函数的具体用法?C++ RemoveFile怎么用?C++ RemoveFile使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RemoveFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyExternalProgram
//-----------------------------------------------------------------------------
LISTNODE ApplyExternalProgram(LISTNODE Head,StatusType AsStatus,
ANNOTATEDFORMULA Conjecture,char * ExecuteFormatString,SIGNATURE Signature) {
String ProblemFileName;
String ExecuteCommand;
FILE * ProcessHandle;
LISTNODE AppliedHead;
if(!MakeProblemFile("/tmp",NULL,NULL,ProblemFileName,Head,AsStatus,
Conjecture,conjecture)) {
return(NULL);
}
if (sprintf(ExecuteCommand,ExecuteFormatString,ProblemFileName) == -1) {
printf("ERROR: Cannot make command from %s\n",ExecuteFormatString);
RemoveFile(ProblemFileName);
return(NULL);
}
if ((ProcessHandle = popen(ExecuteCommand,"r")) == NULL) {
perror(ExecuteCommand);
printf("ERROR: Cannot execute %s\n",ExecuteCommand);
RemoveFile(ProblemFileName);
return(NULL);
}
AppliedHead = ParseFILEOfFormulae(ProcessHandle,Signature,1,NULL);
pclose(ProcessHandle);
RemoveFile(ProblemFileName);
return(AppliedHead);
}
示例2: RemoveGambitTempFiles
static void RemoveGambitTempFiles( const CString& appDir )
{
RemoveFile( appDir + GAMBIT_JOU_FILE );
RemoveFile( appDir + GAMBIT_TRN_FILE );
RemoveFile( appDir + GAMBIT_DBS_FILE );
RemoveFile( appDir + GAMBIT_LOK_FILE );
RemoveFile( appDir + GAMBIT_ERROR_FILE );
}
示例3: GetActiveFilePath
void WorkspaceWork::DelFile()
{
if(!filelist.IsCursor() || filelist[fileindex[filelist.GetCursor()]].isdir) return;
String file = GetActiveFilePath();
if(IsFolder(file)) {
if(!PromptYesNo("Remove the topic group and discard ALL topics?")) return;
RemoveFile();
DeleteFolderDeep(file);
}
else {
if(!PromptYesNo("Remove the file from package and discard it ?")) return;
RemoveFile();
::DeleteFile(file);
}
}
示例4: QFileInfo
bool ProjectFile::LinkFile(QString oldFile, QString newDir)
{
QString newLink = newDir + QDir::separator() + QFileInfo(oldFile).fileName();
#ifdef Q_OS_WIN32
newLinkName.append(".lnk");
#endif
if (CheckForExistingFile(newLink))
{
if (WarnFileExists(newLink))
{
RemoveFile(newLink);
} else {
return false;
}
}
QFile file (oldFile);
if (file.exists())
{
return file.link(newLink);
}
return false;
}
示例5: GetFileName
void SceneryPage::CheckAutosave(int& debugPagesSaved, int& debugPropsSaved)
{
if(mPendingChanges == 0)
return;
char buffer[256];
if(mSceneryList.size() == 0)
{
GetFileName(buffer, sizeof(buffer));
RemoveFile(buffer);
mPendingChanges = 0;
}
else
{
if(mHasSourceFile == false)
{
GetFolderName(buffer, sizeof(buffer));
Platform::MakeDirectory(buffer);
}
GetFileName(buffer, sizeof(buffer));
if(SaveFile(buffer) == true)
{
mPendingChanges = 0;
debugPropsSaved += mSceneryList.size();
mHasSourceFile = true;
}
}
debugPagesSaved++;
}
示例6: acoral_unlink
acoral_32 acoral_unlink(const acoral_char *pathname)
{
acoral_u32 ret;
acoral_u8 fs_ret,len;
acoral_char *path;
len=acoral_str_len(pathname);
if(path=(acoral_char *)acoral_malloc2(len+1))
{
acoral_str_cpy(path,pathname);
path[len]=0;
}
else
return -1;
ret=acoral_mutex_pend(fs_mutex,0);
if(ret!=MUTEX_SUCCED)
{
acoral_free2(path);
return -1;
}
fs_ret=RemoveFile(path);
acoral_mutex_post(fs_mutex);
acoral_free2(path);
if(fs_ret!=RETURN_OK)
return -1;
return 0;
}
示例7: GetFileIndex
size_t TokensTree::ReserveFileForParsing(const wxString& filename,bool preliminary)
{
size_t index = GetFileIndex(filename);
if(m_FilesToBeReparsed.count(index) &&
(!m_FilesStatus.count(index) || m_FilesStatus[index]==fpsDone))
{
RemoveFile(filename);
m_FilesToBeReparsed.erase(index);
m_FilesStatus[index]=fpsNotParsed;
}
if(m_FilesStatus.count(index))
{
FileParsingStatus status = m_FilesStatus[index];
if(preliminary)
{
if(status >= fpsAssigned)
return 0; // Already assigned
}
else
{
if(status > fpsAssigned)
return 0; // No parsing needed
}
}
m_FilesToBeReparsed.erase(index);
m_FilesStatus[index]=preliminary ? fpsAssigned : fpsBeingParsed; // Reserve file
return index;
}
示例8: ClearShared
int XCatch::Clear(XU8 bAll)
{
int nCount=0;
int nTotalCount=0;
ClearShared();
XStackC<XString8> paths;
paths.Push(m_strWorkPath);
while(paths.GetSize()>0)
{
XString8 strPath;//=paths[paths.GetSize()-1];
paths.Pop(strPath);
//paths.RemoveAt(paths.GetSize()-1);
XString8 strRoot=strPath;
XFileFinder find;
XU8 bEmpty=XTRUE;
if(find.FindFirst(strPath))//) continue;
{
while(XTRUE)
{
//XString8 strFile=strRoot;
XString8 strFile=find.cFileName;
if(find.IsDirectory())
{
if(strFile!="."&&
strFile!="..")
{
strFile=strRoot;
strFile += "/";
strFile+=find.cFileName;
paths.Push(strFile);
}
}
else
{
strFile=strRoot;
strFile += "/";
strFile+=find.cFileName;
nTotalCount++;
if(RemoveFile(strFile,bAll))
{
nCount++;
}
else bEmpty=XFALSE;
}
if(!find.FindNext())
break;
}
find.Close();
}
nTotalCount++;
find.Close();
if((bAll||bEmpty)&&strRoot!=m_strWorkPath)
{
XFile::RemoveFolder(strRoot);
nCount++;
}
}
return nCount;
}
示例9: CZipFileHeader
// add new header using the argument as a template
CZipFileHeader* CZipCentralDir::AddNewFile(const CZipFileHeader & header, int iReplaceIndex)
{
CZipFileHeader* pHeader = new CZipFileHeader(header);
m_pOpenedFile = pHeader;
WORD uIndex;
DWORD uOffset = 0;
bool bReplace = IsValidIndex(iReplaceIndex);
if (bReplace)
{
CZipFileHeader* pfh = m_headers[iReplaceIndex];
uOffset = pfh->m_uOffset + m_info.m_uBytesBeforeZip;
RemoveFile(pfh, iReplaceIndex, false);
m_headers.InsertAt(iReplaceIndex, pHeader);
uIndex = (WORD)iReplaceIndex;
}
else
uIndex = m_headers.Add(pHeader);
if (m_bFindFastEnabled)
InsertFindFastElement(pHeader, uIndex); // GetCount > 0, 'cos we've just added a header
RemoveFromDisk();
if (bReplace)
m_pStorage->m_pFile->Seek(uOffset, CZipAbstractFile::begin);
else
m_pStorage->m_pFile->SeekToEnd();
return pHeader;
}
示例10: pImpl
TimeSmoother::TimeSmoother() :
pImpl(new TimeSmootherImpl) {
//read in S
std::string tmpFileName = CreateTemporaryEmptyFile();
WriteCharBufferToFile(tmpFileName, globalsmoothtvmatrix_dat,
globalsmoothtvmatrix_dat_len);
Harwell_Boeing_load(tmpFileName.c_str(), pImpl->S);
RemoveFile(tmpFileName);
std::string prior = WriteCharBufferToString(timevaryingprior_dat,
timevaryingprior_dat_len);
std::stringstream ss(std::stringstream::in | std::stringstream::out);
ss << prior;
for (int row = 0; row < 11; row++) {
for (int col = 0; col < 134; col++) {
ss >> pImpl->Priors(row, col);
}
for (int col = 0; col < 80; col++) {
double temp;
ss >> temp; // mu and theta?
}
}
}
示例11: UninstallToolRecord
bool UninstallToolRecord( bool adjust_uac )
{
TCHAR path_dst[MAX_PATH * 2];
if (!GetProductBinDir(path_dst, ARRAYSIZE(path_dst)))
{
return false;
}
::PathAppend(path_dst, TEXT("toolRecord.dll"));
if (INVALID_FILE_ATTRIBUTES == ::GetFileAttributes(path_dst))
{
return true;
}
if (!RemoveFile(path_dst))
{
if (adjust_uac)
{
if (!IsRunAsAdmin())
{
TCHAR path_exe[MAX_PATH * 2];
::GetModuleFileName(NULL, path_exe, ARRAYSIZE(path_exe));
LaunchUacApp(path_exe, TEXT("unst_tool_record"), true);
}
}
}
DWORD file_attr = GetFileAttributes(path_dst);
return INVALID_FILE_ATTRIBUTES == file_attr;
}
示例12: SetMarkFile
/*** SetMarkFile - Change markfile
*
* Purpose:
*
* Changes to a new markfile.
*
* Input:
* val - String after the 'markfile' switch
*
* Output:
*
* Returns Error string if error, NULL otherwise
*
* Notes:
*
* We:
*
* UNDONE:o Magically ensure that the current markfile is up to date and
* saved to disk. This means, at the very least, that there
* can be no dirty files.
*
* o Remove the current markfile from the file list.
*
* o Read in the new markfile.
*
* o Invalidate all current marks. This is just marking them
* invalid in the PFILE.
*
*
*************************************************************************/
char *
SetMarkFile (
char *val
) {
REGISTER PFILE pFile;
buffer tmpval;
pathbuf pathname;
strcpy ((char *) tmpval, val);
if (NULL == CanonFilename (tmpval, pathname)) {
sprintf (buf, "'%s': name is malformed", tmpval);
return buf;
}
if (!(pFile = FileNameToHandle (pathname, NULL))) {
pFile = AddFile (pathname);
}
if (!TESTFLAG(FLAGS(pFile), REAL) && !FileRead (pathname, pFile, FALSE)) {
RemoveFile (pFile);
sprintf (buf, "'%s' - %s", pathname, error());
return buf;
}
pFileMark = pFile;
for (pFile = pFileHead; pFile; pFile = pFile->pFileNext) {
if (!TESTFLAG(FLAGS(pFile), FAKE)) {
RSETFLAG (FLAGS(pFile), VALMARKS);
}
}
return NULL;
}
示例13: InsertFileOrGetIndex
size_t TokenTree::ReserveFileForParsing(const wxString& filename, bool preliminary)
{
const size_t fileIdx = InsertFileOrGetIndex(filename);
if ( m_FilesToBeReparsed.count(fileIdx)
&& (!m_FileStatusMap.count(fileIdx) || m_FileStatusMap[fileIdx]==fpsDone) )
{
RemoveFile(filename);
m_FilesToBeReparsed.erase(fileIdx);
m_FileStatusMap[fileIdx]=fpsNotParsed;
}
if (m_FileStatusMap.count(fileIdx))
{
FileParsingStatus status = m_FileStatusMap[fileIdx];
if (preliminary)
{
if (status >= fpsAssigned)
return 0; // Already assigned
}
else
{
if (status > fpsAssigned)
return 0; // No parsing needed
}
}
m_FilesToBeReparsed.erase(fileIdx);
m_FileStatusMap[fileIdx] = preliminary ? fpsAssigned : fpsBeingParsed; // Reserve file
return fileIdx;
}
示例14: RemoveFolder
HRESULT CFileHelper::RemoveFolder(LPCTSTR path, BOOL removeChildren)
{
vector<WIN32_FIND_DATA> fileDatas;
if(_ListChildren(path, fileDatas))
{
for(int i=0,size = fileDatas.size() ; i<size;i++)
{
LPCTSTR path = fileDatas[i].cFileName;
if(BIT_IS_TRUE( fileDatas[i].dwFileAttributes, FILE_ATTRIBUTE_DIRECTORY) && removeChildren)
{
HRESULT hr = RemoveFolder(path, removeChildren);
if(FAILED(hr)) return hr;
}
else
{
HRESULT hr = RemoveFile(path);
if(FAILED(hr)) return hr;
}
}
return S_OK;
}
return E_FAIL;
}
示例15: DecFileRef
/* DecFileRef - remove a reference to a file
*
* When the reference count goes to zero, we remove the file from the memory
* set
*/
void
DecFileRef (
PFILE pFileTmp
) {
if (--(pFileTmp->refCount) <= 0) {
RemoveFile (pFileTmp);
}
}