当前位置: 首页>>代码示例>>C++>>正文


C++ RemoveFile函数代码示例

本文整理汇总了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);
}
开发者ID:mihasighi,项目名称:smtcomp14-sl,代码行数:29,代码来源:SystemOnTPTP.c

示例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 );
}
开发者ID:kanbang,项目名称:myexercise,代码行数:8,代码来源:FluentTool.cpp

示例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);
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:15,代码来源:UppWspc.cpp

示例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;
}
开发者ID:atdyer,项目名称:adcircSubdomainTool,代码行数:25,代码来源:ProjectFile.cpp

示例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++;
}
开发者ID:tremblewithfear6,项目名称:iceee,代码行数:31,代码来源:Scenery2.cpp

示例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;
}
开发者ID:ChenZewei,项目名称:acoral,代码行数:26,代码来源:os_file.c

示例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;
}
开发者ID:ohosrry,项目名称:visualfc,代码行数:28,代码来源:token.cpp

示例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;
}
开发者ID:hgl888,项目名称:nashtest,代码行数:60,代码来源:XCatch.cpp

示例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;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:28,代码来源:ZipCentralDir.cpp

示例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?
		}
	}

}
开发者ID:ABI-Software,项目名称:ICMA,代码行数:25,代码来源:timesmoother.cpp

示例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;
}
开发者ID:yedaoq,项目名称:YedaoqToolSpace,代码行数:30,代码来源:util.cpp

示例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;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:65,代码来源:mark.c

示例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;
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:29,代码来源:tokentree.cpp

示例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;
}
开发者ID:bestustc,项目名称:MyTutorial,代码行数:27,代码来源:FileHelper.cpp

示例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);
    }
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:13,代码来源:file.c


注:本文中的RemoveFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。