您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CloseFile函数代码示例

51自学网 2021-06-01 20:11:44
  C++
这篇教程C++ CloseFile函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CloseFile函数的典型用法代码示例。如果您正苦于以下问题:C++ CloseFile函数的具体用法?C++ CloseFile怎么用?C++ CloseFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CloseFile函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CloseFile

void QuickView::ShowFile(const string& FileName, bool TempFile, PluginHandle* hDirPlugin){	CloseFile();	if (!IsVisible())		return;	if (FileName.empty())	{		ProcessingPluginCommand++;		Show();		ProcessingPluginCommand--;		return;	}	string FileFullName = FileName;	if (!hDirPlugin) ConvertNameToFull(FileFullName, FileFullName);	bool SameFile = strCurFileName == FileFullName;	strCurFileName = FileFullName;	size_t pos = strCurFileName.rfind(L'.');	if (pos != string::npos)	{		string strValue;		if (GetShellType(strCurFileName.data()+pos, strValue))		{			api::reg::GetValue(HKEY_CLASSES_ROOT, strValue, L"", strCurFileType);		}	}	if (hDirPlugin || api::fs::is_directory(strCurFileName))	{		// Не показывать тип файла для каталогов в "Быстром просмотре"		strCurFileType.clear();		if (SameFile && !hDirPlugin)		{			Directory=1;		}		else if (hDirPlugin)		{			int ExitCode=GetPluginDirInfo(hDirPlugin,strCurFileName,Data.DirCount,			                              Data.FileCount,Data.FileSize,Data.AllocationSize);			Directory = (ExitCode ? 4 : 3);			uncomplete_dirscan = (ExitCode == 0);		}		else		{			int ExitCode=GetDirInfo(MSG(MQuickViewTitle), strCurFileName, Data, getdirinfo_default_delay, nullptr, GETDIRINFO_ENHBREAK|GETDIRINFO_SCANSYMLINKDEF|GETDIRINFO_NOREDRAW);			Directory = (ExitCode == -1 ? 2 : 1); // ExitCode: 1=done; 0=Esc,CtrlBreak; -1=Other			uncomplete_dirscan = ExitCode != 1;		}	}	else	{		if (!strCurFileName.empty())		{			QView.reset(new Viewer(GetOwner(), true));			QView->SetRestoreScreenMode(false);			QView->SetPosition(m_X1+1,m_Y1+1,m_X2-1,m_Y2-3);			QView->SetStatusMode(0);			QView->EnableHideCursor(0);			OldWrapMode = QView->GetWrapMode();			OldWrapType = QView->GetWrapType();			QView->SetWrapMode(LastWrapMode);			QView->SetWrapType(LastWrapType);			QView->OpenFile(strCurFileName,FALSE);		}	}	if (this->Destroyed())		return;	m_TemporaryFile = TempFile;	Redraw();	if (Parent()->ActivePanel() == this)	{		DynamicUpdateKeyBar();		Parent()->GetKeybar().Redraw();	}}
开发者ID:Frankie-666,项目名称:farmanager,代码行数:84,


示例2: file_close

short file_close(FILEH handle) {	CloseFile(handle);	return(0);}
开发者ID:perabuss,项目名称:np2wii,代码行数:5,


示例3: process_data

stat_record_t process_data(char *wfile, int element_stat, int flow_stat, int sort_flows,	printer_t print_header, printer_t print_record, time_t twin_start, time_t twin_end, 	uint64_t limitflows, int tag, int compress, int do_xstat) {common_record_t 	*flow_record;master_record_t		*master_record;nffile_t			*nffile_w, *nffile_r;xstat_t				*xstat;stat_record_t 		stat_record;int 				done, write_file;#ifdef COMPAT15int	v1_map_done = 0;#endif		// time window of all matched flows	memset((void *)&stat_record, 0, sizeof(stat_record_t));	stat_record.first_seen = 0x7fffffff;	stat_record.msec_first = 999;	// Do the logic first	// print flows later, when all records are processed and sorted	// flow limits apply at that time	if ( sort_flows ) {		print_record = NULL;		limitflows   = 0;	}	// do not print flows when doing any stats	if ( flow_stat || element_stat ) {		print_record = NULL;		limitflows   = 0;	}	// do not write flows to file, when doing any stats	// -w may apply for flow_stats later	write_file = !(sort_flows || flow_stat || element_stat) && wfile;	nffile_r = NULL;	nffile_w = NULL;	xstat  	 = NULL;	// Get the first file handle	nffile_r = GetNextFile(NULL, twin_start, twin_end);	if ( !nffile_r ) {		LogError("GetNextFile() error in %s line %d: %s/n", __FILE__, __LINE__, strerror(errno) );		return stat_record;	}	if ( nffile_r == EMPTY_LIST ) {		LogError("Empty file list. No files to process/n");		return stat_record;	}	// preset time window of all processed flows to the stat record in first flow file	t_first_flow = nffile_r->stat_record->first_seen;	t_last_flow  = nffile_r->stat_record->last_seen;	// store infos away for later use	// although multiple files may be processed, it is assumed that all 	// have the same settings	is_anonymized = IP_ANONYMIZED(nffile_r);	strncpy(Ident, nffile_r->file_header->ident, IDENTLEN);	Ident[IDENTLEN-1] = '/0';	// prepare output file if requested	if ( write_file ) {		nffile_w = OpenNewFile(wfile, NULL, compress, IP_ANONYMIZED(nffile_r), NULL );		if ( !nffile_w ) {			if ( nffile_r ) {				CloseFile(nffile_r);				DisposeFile(nffile_r);			}			return stat_record;		}		if ( do_xstat ) {			xstat = InitXStat(nffile_w);			if ( !xstat ) {				if ( nffile_r ) {					CloseFile(nffile_r);					DisposeFile(nffile_r);				}				return stat_record;			}		}	}	// setup Filter Engine to point to master_record, as any record read from file	// is expanded into this record	// Engine->nfrecord = (uint64_t *)master_record;	done = 0;	while ( !done ) {	int i, ret;		// get next data block from file		ret = ReadBlock(nffile_r);		switch (ret) {			case NF_CORRUPT:			case NF_ERROR:				if ( ret == NF_CORRUPT ) //.........这里部分代码省略.........
开发者ID:ETredgo,项目名称:NetflowDB,代码行数:101,


示例4: CloseFile

CFileInStream::~CFileInStream(){	CloseFile();}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:4,


示例5: CloseFile

vtkDCMParser::~vtkDCMParser(){  CloseFile();  //delete [] aux_ret;}
开发者ID:fedral,项目名称:paper,代码行数:5,


示例6: CloseFile

AppenderFile::~AppenderFile(){    CloseFile();}
开发者ID:Lyill,项目名称:TrinityCore,代码行数:4,


示例7: while

bool RPCFile::ChannelReader::ReadData(void* dest, uint64_t numBytes){	// When an error condition is encountered, m_file is set to NULL.	if(!m_file)		return false;	uint64_t availOut = numBytes;	char* writePtr = (char*)dest;	uint64_t streamEnd = m_chanInfo->GetDataOffset() + m_chanInfo->GetCompressedSize();		while( (availOut > 0) && (m_readOffset < streamEnd) )	{		// We need to position the read pointer each time to notify the file reader that we've		// consumed the bytes returned by GetBuffer().		m_file->SetReadPtr(m_readOffset);		// Get a pointer to the data present in the reader's cache.		uint32_t bufferSize;		m_inflateCtx.next_in = (const Bytef*)m_file->GetBuffer(&bufferSize);		if(!m_inflateCtx.next_in)		{			CloseFile();			return false;		}		// Make sure we don't run past the end of the channel.		uint64_t availIn = streamEnd - m_readOffset;		if(availIn > bufferSize)			availIn = bufferSize;		m_inflateCtx.avail_in = (uInt)availIn;		// zlib uses 32-bit sizes, so we need to clamp the size in case somebody really wants to		// read more than 4 GB in one go. This isn't a problem for availIn because bufferSize is 32-bit.		m_inflateCtx.avail_out = (uInt)((availOut < UINT_MAX) ? availOut : UINT_MAX);		m_inflateCtx.next_out = (Bytef*)writePtr;		int inflateResult = inflate(&m_inflateCtx, Z_NO_FLUSH);		if( (inflateResult != Z_OK) && (inflateResult != Z_STREAM_END) )		{			CloseFile();			return false;		}		uint32_t readBytes = (uint32_t)(availIn - m_inflateCtx.avail_in);		m_readOffset += readBytes;		if( (m_readOffset == streamEnd) && (inflateResult != Z_STREAM_END) )		{			// We've reached the end of the compressed data, but zlib doesn't think so.			CloseFile();			return false;		}		if( (inflateResult == Z_STREAM_END) && (m_readOffset != streamEnd) )		{			// zlib says the stream ended, but we have more data in the file.			CloseFile();			return false;		}		uint64_t writtenBytes = availOut - m_inflateCtx.avail_out;		writePtr += writtenBytes;		availOut -= writtenBytes;	}	if(availOut > 0)	{		// If we reached the end of the stream without filling up the output buffer, it's		// an error on the caller's side.		CloseFile();		return false;	}	return true;}
开发者ID:nextlimit,项目名称:realflow-file-formats,代码行数:77,


示例8: CloseFile

cElCompileFN::~cElCompileFN(){   CloseFile();   delete mNamesLoc;   delete mDicSymb;}
开发者ID:archeos,项目名称:micmac-archeos,代码行数:6,


示例9: SetFile

void cElCompileFN::MakeFileCpp(std::vector<Fonc_Num> vFoncs,bool SpecFCUV){   SetFile("cpp","h");   int aDimOut = (int)vFoncs.size();// Constructeur :    (*this) << mNameClass << "::" << mNameClass << "():/n";   (*this) << "    cElCompiledFonc(" <<  aDimOut << ")/n";   (*this) << "{/n";   const cMapIncInterv & aMap =  mListInterv.Map();   for (tCSetIII itCur = aMap.begin() ; itCur != aMap.end() ; itCur++)   {      (*this) << "   AddIntRef (cIncIntervale("              <<  "/"" <<  itCur->Id()  <<  "/""               <<  "," << itCur->I0Alloc()              <<  "," << itCur->I1Alloc()              << "));/n";   }   (*this) << "   Close(false);/n";   (*this) << "}/n";   (*this) << "/n/n/n";   MakeFonc(vFoncs,0,SpecFCUV);   MakeFonc(vFoncs,1,SpecFCUV);   MakeFonc(vFoncs,2,SpecFCUV);// Calcul des Fonction SetVar   (*this) << "/n";   for (cECFN_SetString::const_iterator it = mNamesLoc->begin(); it!=mNamesLoc->end() ; it++)   {       (*this)  << "void " << mNameClass << "::Set"<< it->Name() << "(double aVal){ "                << NameVarLoc(it->Name()) << " = aVal;}/n";   }   (*this) << "/n/n/n";// Fonction AdrVarLocFromString :    (*this) << "double * " << mNameClass << "::AdrVarLocFromString(const std::string & aName)/n";   (*this) << "{/n";   {   for (cECFN_SetString::const_iterator it = mNamesLoc->begin(); it!=mNamesLoc->end() ; it++)   {       (*this)   << "   if (aName == /""                  << (it->Name()) << "/") return & "                  << NameVarLoc(it->Name())                  << ";/n";   }   }   (*this) << "   return 0;/n";   (*this) << "}/n/n/n";   (*this)  << "cElCompiledFonc::cAutoAddEntry "  	    << mNameClass << "::mTheAuto"	    << "(/"" << mNameClass << "/"," 	    << mNameClass << "::Alloc);/n/n/n";   (*this)  << "cElCompiledFonc *  " << mNameClass << "::Alloc()/n";   (*this)  << "{";   (*this)  << "  return new " << mNameClass << "();/n";   (*this)  << "}/n/n/n";       CloseFile();}
开发者ID:archeos,项目名称:micmac-archeos,代码行数:74,


示例10: CloseFile

WavSplitWriter::~WavSplitWriter(){	CloseFile();}
开发者ID:katakk,项目名称:BonTsDemuxMod,代码行数:4,


示例11: reduced_covers

int reduced_covers (FILE *descendant_file, FILE *covers_file, int k, int ***auts, struct pga_vars *pga, struct pcp_vars *pcp){   int lower_step, upper_step;   int nmr_of_covers = 0;   int *a, *b;                  /* arrays needed for orbit calculation */   char *c;                     /* array needed for stabiliser calculation */   int **perms;                 /* store all permutations */   int *orbit_length;           /* length of orbits */   FILE * LINK_input;        /* input file for GAP */#if defined (GAP_LINK)    Logical process_fork = FALSE; /* has GAP process forked? */        #endif   Logical soluble_group;       /* indicates that orbits and stabilisers may 				   be computed using soluble machinery */   /* calculate the extended automorphisms */   extend_automorphisms (auts, pga->m, pcp);   if (pcp->overflow) return 0;   if (pga->print_extensions && pga->m != 0) {        printf ("/nThe extension%s:/n", pga->m == 1 ? " is" : "s are");      print_auts (pga->m, pcp->lastg, auts, pcp);   }   /* find range of permitted step sizes */   step_range (k, &lower_step, &upper_step, auts, pga, pcp);   /* set up space for definition sets */   store_definition_sets (pga->r, lower_step, upper_step, pga);   /* loop over each permitted step size */    for (pga->s = lower_step; pga->s <= upper_step; ++pga->s) {      if (pga->trace)	 trace_details (pga);      get_definition_sets (pga);      compute_degree (pga);      /* establish which automorphisms induce the identity 	 on the relevant subgroup of the p-multiplicator */      strip_identities (auts, pga, pcp);      /* if possible, use the more efficient soluble code --	 in particular, certain extreme cases can be handled */      soluble_group = (pga->soluble || pga->Degree == 1 || 		       pga->nmr_of_perms == 0);      if (!soluble_group) {#if defined (GAP_LINK) 	 if (!process_fork) {	    start_GAP_file (auts, pga);	    process_fork = TRUE;	 }	 StartGapFile (pga);#else#if defined (GAP_LINK_VIA_FILE) 	 start_GAP_file (&LINK_input, auts, pga, pcp);#endif#endif      }      perms = permute_subgroups (LINK_input, &a, &b, &c, auts, pga, pcp);      if (!pga->space_efficient) {	 if (soluble_group)	    compute_orbits (&a, &b, &c, perms, pga);	 else	    insoluble_compute_orbits (&a, &b, &c, perms, pga);      }      orbit_length = find_orbit_reps (a, b, pga);      if (pga->print_orbit_summary)	 orbit_summary (orbit_length, pga);      if (soluble_group && pga->print_orbit_arrays)	 print_orbit_information (a, b, c, pga);      pga->final_stage = (pga->q == pga->multiplicator_rank);      if (!soluble_group) {#if defined (GAP_LINK_VIA_FILE) 	 CloseFile (LINK_input);#endif       }      setup_reps (pga->rep, pga->nmr_orbits, orbit_length, perms, a, b, c, 		  auts, descendant_file, covers_file, pga, pcp);      if (!pga->final_stage)	 nmr_of_covers += pga->nmr_orbits;      free_space (soluble_group, perms, orbit_length, 		  a, b, c, pga);    }     #if defined (GAP_LINK)   if (process_fork)       QuitGap ();#endif //.........这里部分代码省略.........
开发者ID:fingolfin,项目名称:gap-osx-binary,代码行数:101,


示例12: main

//.........这里部分代码省略.........    filename=strcpy(malloc(strlen(argv[arg])+1),argv[arg]);    fd=OpenFile(filename);    if((p=strstr(filename,".bz2")) && !strcmp(p,".bz2"))      {       fd=Uncompress_Bzip2(fd);       *p=0;      }    if((p=strstr(filename,".gz")) && !strcmp(p,".gz"))      {       fd=Uncompress_Gzip(fd);       *p=0;      }    if((p=strstr(filename,".xz")) && !strcmp(p,".xz"))      {       fd=Uncompress_Xz(fd);       *p=0;      }    printf("/nParse OSM Data [%s]/n==============/n/n",filename);    fflush(stdout);    if((p=strstr(filename,".pbf")) && !strcmp(p,".pbf"))      {       if(ParsePBFFile(fd,OSMNodes,OSMWays,OSMRelations))          exit(EXIT_FAILURE);      }    else if((p=strstr(filename,".o5m")) && !strcmp(p,".o5m"))      {       if(ParseO5MFile(fd,OSMNodes,OSMWays,OSMRelations))          exit(EXIT_FAILURE);      }    else      {       if(ParseOSMFile(fd,OSMNodes,OSMWays,OSMRelations))          exit(EXIT_FAILURE);      }    CloseFile(fd);    free(filename);   } DeleteXMLTaggingRules(); FinishNodeList(OSMNodes); FinishWayList(OSMWays); FinishRelationList(OSMRelations); /* Sort the data */ printf("/nSort OSM Data/n=============/n/n"); fflush(stdout); /* Sort the nodes, ways and relations */ SortNodeList(OSMNodes); SortWayList(OSMWays); SortRelationList(OSMRelations); /* Process the data */ RenameFile(OSMNodes->filename_tmp,OSMNodes->filename); RenameFile(OSMWays->filename_tmp,OSMWays->filename); RenameFile(OSMRelations->rrfilename_tmp,OSMRelations->rrfilename); RenameFile(OSMRelations->trfilename_tmp,OSMRelations->trfilename); close_errorlog(); printf("/nCreate Error Log/n================/n/n"); fflush(stdout); OSMErrorLogs=NewErrorLogList(); ProcessErrorLogs(OSMErrorLogs,OSMNodes,OSMWays,OSMRelations); SortErrorLogsGeographically(OSMErrorLogs); SaveErrorLogs(OSMErrorLogs,FileName(dirname,prefix,"fixme.mem")); FreeErrorLogList(OSMErrorLogs); /* Free the memory (delete the temporary files) */ FreeNodeList(OSMNodes,0); FreeWayList(OSMWays,0); FreeRelationList(OSMRelations,0); printf("/n"); fflush(stdout); printf_program_end(); exit(EXIT_SUCCESS);}
开发者ID:svn2github,项目名称:routino,代码行数:101,


示例13: CloseFile

CDummyVideoPlayer::~CDummyVideoPlayer(){  CloseFile();}
开发者ID:SunSeosahai,项目名称:xbmc,代码行数:4,


示例14: av_write_trailer

void AVIDump::Stop(){	av_write_trailer(s_format_context);	CloseFile();	NOTICE_LOG(VIDEO, "Stopping frame dump");}
开发者ID:absolome,项目名称:dolphin,代码行数:6,


示例15: CloseFile

Log::~Log(){    CloseFile();	DeleteCriticalSection( &m_criLock );	}
开发者ID:tianyx,项目名称:TxUIProject,代码行数:5,


示例16: CloseFile

MetaIOID3::~MetaIOID3(void){    CloseFile();}
开发者ID:camdbug,项目名称:mythtv,代码行数:4,


示例17: while

char  * ConfigBase::GetConfigLine( ){	static char buf[128];	static char stat=0;	char *ptr = NULL;	int     buflen=128;		if (NULL == fp)	{		if (OpenFile( ) != E_SUCC)		{			return NULL;		}	}		while (GetLine(buf, buflen) != NULL)	{		ptr=buf;		if (0 == stat)		{			if (! strcmp(m_sField, ""))			{				stat=1;			}			else if (strstr(buf, m_sField))			{				stat=1;				continue;			}		}		if (0 == stat)		{			continue;		}		while (('/t' == *ptr)  ||  (' ' == *ptr))		{	// Delete the pre space and tab.			++ptr;		}		if (*ptr == '[')		{	// This item end.			// r = E_CONFIG_MISS;			break;		}				if ((*ptr == '/0')  ||			(*ptr == '/n')  ||			(*ptr == '/r')  ||			(*ptr == ';')  ||			(*ptr == '#'))		{			continue;		}		else		{			return ptr;		}	}		CloseFile( );	stat = 0;	return NULL;}
开发者ID:cocti-zhonghao,项目名称:gx_missCallAlert,代码行数:65,


示例18: _print_results

static void _print_results(void) {/*======================================================*/  LyrIndex lyr;  TimeInt pd;  GrpIndex g;  RealF sum;  FILE *fp;  fp = OpenFile("testdata.txt","w");  LOG(fp,"===============================================/n");  LOG(fp,"Echoing relative sizes and transpiration values./n/n");  ForEachGroup(g) {    LOG(fp,"%s(%4.3f)/t", RGroup[g]->name, RGroup[g]->relsize);  }  LOG_NL;  ForEachTrPeriod(pd) {    LOG(fp,"%d", pd);    ForEachTreeTranspLayer(lyr)      LOG(fp,"/t%5.4f", SXW.transp[Ilp(lyr,pd)]);    LOG_NL;  }  LOG(fp,"/n===============================================/n");  LOG(fp,"     Relative rooting distributions./n/n");  LOG(fp,"Layer");  ForEachGroup(g) LOG(fp,"/t%s", RGroup[g]->name);  LOG_NL;  ForEachTreeTranspLayer(lyr) {    LOG(fp,"%d", lyr);    ForEachGroup(g)      LOG(fp, "/t%5.4f", _roots_rel[Ilg(lyr,g)]);    LOG_NL;  }  LOG(fp,"/n===============================================/n");  LOG(fp,"     Relative phenology./n/n");  LOG(fp,"Group");  ForEachTrPeriod(pd) LOG(fp,"/t%d", pd);  LOG_NL;  ForEachGroup(g) {    LOG(fp,"%s", RGroup[g]->name);    ForEachTrPeriod(pd)      LOG(fp,"/t%5.4f", _phen_grp_rel[Igp(g,pd)]);    LOG_NL;  }  LOG(fp,"/n===============================================/n");  LOG(fp,"  Check rel vals for rel phen X rel roots./n/n");  LOG_NL;  ForEachGroup(g) {    LOG(fp,"/n  ------  %s  -------/n", RGroup[g]->name);    ForEachTrPeriod(pd) LOG(fp,"/t%d", pd);    LOG_NL;    ForEachTreeTranspLayer(lyr) {      LOG(fp,"%d", lyr);      ForEachTrPeriod(pd)        LOG(fp,"/t%5.4f", _roots_active[Iglp(g,lyr,pd)]);    LOG_NL;    }  }  LOG(fp,"/n===============================================/n");  LOG(fp,"  Totals for rel roots X rel phen./n/n");  LOG(fp,"Layer//Mon");  ForEachTrPeriod(pd) LOG(fp,"/t%d", pd);  LOG_NL;  ForEachTreeTranspLayer(lyr) {    LOG(fp,"%d", lyr);    ForEachTrPeriod(pd)      LOG(fp,"/t%5.4f", _roots_phen_totals[Ilp(lyr,pd)]);    LOG_NL;  }  LOG(fp,"/n===============================================/n");  LOG(fp,"  Contribution to period's transpiration by group./n/n");  LOG(fp,"Group");  ForEachTrPeriod(pd) LOG(fp,"/t%d", pd);  LOG_NL;  ForEachGroup(g) {    LOG(fp,"%s", RGroup[g]->name);    ForEachTrPeriod(pd) {      sum = 0.;      ForEachTreeTranspLayer(lyr) {        sum += _roots_active[Iglp(g,lyr,pd)]            *  SXW.transp[Ilp(lyr,pd)];      }      LOG(fp,"/t%5.4f", sum);    }    LOG_NL;  }  CloseFile(&fp);}
开发者ID:Burke-Lauenroth-Lab,项目名称:stepwat_spinup_test,代码行数:97,


示例19: main

intmain() {  int fd;  int loopCnt;  int byteOffset= 0;  char strData[MaxBlockLength];  char fileName[32] = "writeTest.txt";  /*****************************/  /* Initialize the system     */  /*****************************/    if( InitReplFs( ReplFsPort, 0, 1 ) < 0 ) {    fprintf( stderr, "Error initializing the system/n" );    return( ErrorExit );  }  /*****************************/  /* Open the file for writing */  /*****************************/  fd = OpenFile( fileName );  if ( fd < 0 ) {    fprintf( stderr, "Error opening file '%s'/n", fileName );    return( ErrorExit );  }  /**************************************/  /* Write incrementing numbers to the file */  /**************************************/  for ( loopCnt=0; loopCnt<8; loopCnt++ ) {    sprintf( strData, "%d/n", loopCnt );#ifdef DEBUG    printf( "%d: Writing '%s' to file./n", loopCnt, strData );#endif    if ( WriteBlock( fd, strData, byteOffset, strlen( strData ) ) < 0 ) {      printf( "Error writing to file %s [LoopCnt=%d]/n", fileName, loopCnt );      return( ErrorExit );    }    byteOffset += strlen( strData );      }  /**********************************************/  /* Can we commit the writes to the server(s)? */  /**********************************************/  if ( Commit( fd ) < 0 ) {    printf( "Could not commit changes to File '%s'/n", fileName );    return( ErrorExit );  }  /**************************************/  /* Close the writes to the server(s) */  /**************************************/  if ( CloseFile( fd ) < 0 ) {    printf( "Error Closing File '%s'/n", fileName );    return( ErrorExit );  }  printf( "Writes to file '%s' complete./n", fileName );  return( NormalExit );}
开发者ID:liyunlulu1990,项目名称:replFs,代码行数:68,


示例20: CloseFile

int textfile_c::CloseTextFile() {  delete buffer;  CloseFile();  return 0;}
开发者ID:fholler0371,项目名称:fhs-utils,代码行数:5,


示例21: CloseFile

PAPlayer::~PAPlayer(){  CloseFile();  delete m_FileItem;}
开发者ID:7orlum,项目名称:xbmc,代码行数:5,


示例22: GetInternal

bool CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& options,                                  const CPlayerCoreFactory &factory,                                  const std::string &playerName, IPlayerCallback& callback){  // get player type  std::string newPlayer;  if (!playerName.empty())    newPlayer = playerName;  else    newPlayer = factory.GetDefaultPlayer(item);  // check if we need to close current player  // VideoPlayer can open a new file while playing  std::shared_ptr<IPlayer> player = GetInternal();  if (player && player->IsPlaying())  {    bool needToClose = false;    if (item.IsDiscImage() || item.IsDVDFile())      needToClose = true;    if (player->m_name != newPlayer)      needToClose = true;    if (player->m_type != "video")      needToClose = true;    if (needToClose)    {      m_nextItem.pItem = std::make_shared<CFileItem>(item);      m_nextItem.options = options;      m_nextItem.playerName = newPlayer;      m_nextItem.callback = &callback;      CloseFile();      if (player->m_name != newPlayer)      {        CSingleLock lock(m_playerLock);        m_pPlayer.reset();      }      return true;    }  }  if (!player)  {    CreatePlayer(factory, newPlayer, callback);    player = GetInternal();    if (!player)      return false;  }  bool ret = player->OpenFile(item, options);  m_nextItem.pItem.reset();  // reset caching timers  m_audioStreamUpdate.SetExpired();  m_videoStreamUpdate.SetExpired();  m_subtitleStreamUpdate.SetExpired();  return ret;}
开发者ID:Montellese,项目名称:xbmc,代码行数:63,


示例23: free

bool U8NandArchive::SetFile( const char* nandPath ){	if(fst)		free(fst);	if(name_table)		free(name_table);	CloseFile();	// open file	if( (fd = ISFS_Open( nandPath, ISFS_OPEN_READ ) ) < 0 )	{		gprintf( "U8NandArchive:  ISFS_Open( /"%s/" ) failed/n", nandPath );		return false;	}	// get file size	fstats stats __attribute__(( aligned( 32 ) ));	int ret = ISFS_GetFileStats( fd, &stats );	if( ret < 0 )	{		CloseFile();		gprintf( "U8NandArchive:  ISFS_GetFileStats( /"%s/" ) failed/n", nandPath );		return false;	}	// buffer for reading the header and stuff	u8* buffer = (u8*)memalign( 32, 0x800 );	if( !buffer )	{		CloseFile();		gprintf( "U8NandArchive: enomem/n" );		return false;	}	// read a chunk big enough that it should contain the U8 header if there is going to be one	if( (ret = ISFS_Read( fd, buffer, 0x800 )) != 0x800 )	{		free( buffer );		CloseFile();		gprintf( "U8NandArchive: ISFS_Read( 0x800 ) = %i/n", ret );		return false;	}	// find the start of the U8 data	U8Header* tagStart = (U8Header*)FindU8Tag( buffer, ret );	if( !tagStart )	{		free( buffer );		CloseFile();		gprintf( "U8NandArchive: didn't see a U8 tag/n" );		return false;	}	// remember where in the file the U8 starts	dataOffset = ( (u8*)tagStart - buffer );	// allocate memory and read the fst	if( !(fst = (FstEntry *)memalign( 32, RU( tagStart->dataOffset - dataOffset, 32 ) ) )			|| ( ISFS_Seek( fd, dataOffset + tagStart->rootNodeOffset, SEEK_SET ) != (s32)( dataOffset + tagStart->rootNodeOffset ) )			|| ( ISFS_Read( fd, fst, tagStart->dataOffset - dataOffset ) != (s32)( tagStart->dataOffset - dataOffset ) )			|| ( fst->filelen * 0xC > tagStart->dataOffset ) )	{		dataOffset = 0;		free( buffer );		if( fst )			free( fst );		CloseFile();		gprintf( "U8NandArchive: error reading fst/n" );	}	// set name table pointer	u32 name_table_offset = fst->filelen * 0xC;	name_table = ((char *)fst) + name_table_offset;	free( buffer );	return true;}
开发者ID:Jeremy-D-Miller,项目名称:usbloader-gui,代码行数:77,


示例24: CloseFile

/* * Destructor */BufferedFile::~BufferedFile(){    CloseFile();}
开发者ID:evan6200,项目名称:Ciphered,代码行数:7,


示例25: main

//.........这里部分代码省略.........	if ( print_order && flow_stat ) {		printf("-s record and -m are mutually exclusive options/n");		exit(255);	}	if ((aggregate || flow_stat || print_order)  && !Init_FlowTable() )			exit(250);	if (element_stat && !Init_StatTable(HashBits, NumPrealloc) )			exit(250);	SetLimits(element_stat || aggregate || flow_stat, packet_limit_string, byte_limit_string);	if ( tstring ) {		if ( !ScanTimeFrame(tstring, &t_start, &t_end) )			exit(255);	}	if ( !(flow_stat || element_stat || wfile || quiet ) && record_header ) {		if ( user_format ) {			printf("%s/n", record_header);		} else {			// static format - no static format with header any more, but keep code anyway			if ( Getv6Mode() ) {				printf("%s/n", record_header);			} else				printf("%s/n", record_header);		}	}	nfprof_start(&profile_data);	sum_stat = process_data(wfile, element_stat, aggregate || flow_stat, print_order != NULL,						print_header, print_record, t_start, t_end, 						limitflows, do_tag, compress, do_xstat);	nfprof_end(&profile_data, total_flows);	if ( total_bytes == 0 ) {		printf("No matched flows/n");		exit(0);	}	if (aggregate || print_order) {		if ( wfile ) {			nffile_t *nffile = OpenNewFile(wfile, NULL, compress, is_anonymized, NULL);			if ( !nffile ) 				exit(255);			if ( ExportFlowTable(nffile, aggregate, bidir, date_sorted, extension_map_list) ) {				CloseUpdateFile(nffile, Ident );				} else {				CloseFile(nffile);				unlink(wfile);			}			DisposeFile(nffile);		} else {			PrintFlowTable(print_record, limitflows, do_tag, GuessDir, extension_map_list);		}	}	if (flow_stat) {		PrintFlowStat(record_header, print_record, topN, do_tag, quiet, csv_output, extension_map_list);#ifdef DEVEL		printf("Loopcnt: %u/n", loopcnt);#endif	} 	if (element_stat) {		PrintElementStat(&sum_stat, record_header, print_record, topN, do_tag, quiet, pipe_output, csv_output);	} 	if ( !quiet ) {		if ( csv_output ) {			PrintSummary(&sum_stat, plain_numbers, csv_output);		} else if ( !wfile ) {			if (is_anonymized)				printf("IP addresses anonymised/n");			PrintSummary(&sum_stat, plain_numbers, csv_output);			if ( t_last_flow == 0 ) {				// in case of a pre 1.6.6 collected and empty flow file 				printf("Time window: <unknown>/n");			} else { 				printf("Time window: %s/n", TimeString(t_first_flow, t_last_flow));			}			printf("Total flows processed: %u, Blocks skipped: %u, Bytes read: %llu/n", 				total_flows, skipped_blocks, (unsigned long long)total_bytes);			nfprof_print(&profile_data, stdout);		}	}	Dispose_FlowTable();	Dispose_StatTable();	FreeExtensionMaps(extension_map_list);#ifdef DEVEL	if ( hash_hit || hash_miss )		printf("Hash hit: %i, miss: %i, skip: %i, ratio: %5.3f/n", hash_hit, hash_miss, hash_skip, (float)hash_hit/((float)(hash_hit+hash_miss)));#endif	return 0;}
开发者ID:ETredgo,项目名称:NetflowDB,代码行数:101,


示例26: ReadUnicodeData

/** * Read the UnicodeData.txt file. * @returns 0 on success. * @returns !0 on failure. * @param   pszBasePath         The base path, can be NULL. * @param   pszFilename         The name of the file. */static int ReadUnicodeData(const char *pszBasePath, const char *pszFilename){    /*     * Open input.     */    FILE *pFile = OpenFile(pszBasePath, pszFilename);    if (!pFile)        return 1;    /*     * Parse the input and spit out the output.     */    char szLine[4096];    RTUNICP i = 0;    while (GetLineFromFile(szLine, sizeof(szLine), pFile) != NULL)    {        if (IsCommentOrBlankLine(szLine))            continue;        char *pszCurField;        char *pszCodePoint = FirstField(&pszCurField, StripLine(szLine)); /* 0 */        char *pszName = NextField(&pszCurField);                          /* 1 */        char *pszGeneralCategory = NextField(&pszCurField);               /* 2 */        char *pszCanonicalCombiningClass = NextField(&pszCurField);       /* 3 */        char *pszBidiClass = NextField(&pszCurField);                     /* 4 */        char *pszDecompositionType = NextField(&pszCurField);             /* 5 */        char *pszDecompositionMapping = SplitDecompField(&pszDecompositionType);        char *pszNumericType = NextField(&pszCurField);                   /* 6 */        char *pszNumericValueD = NextField(&pszCurField);                 /* 7 */        char *pszNumericValueN = NextField(&pszCurField);                 /* 8 */        char *pszBidiMirrored = NextField(&pszCurField);                  /* 9 */        char *pszUnicode1Name = NextField(&pszCurField);                  /* 10 */        char *pszISOComment = NextField(&pszCurField);                    /* 11 */        char *pszSimpleUpperCaseMapping = NextField(&pszCurField);        /* 12 */        char *pszSimpleLowerCaseMapping = NextField(&pszCurField);        /* 13 */        char *pszSimpleTitleCaseMapping = NextField(&pszCurField);        /* 14 */        RTUNICP CodePoint = ToNum(pszCodePoint);        if (CodePoint >= RT_ELEMENTS(g_aCPInfo))        {            ParseError("U+05X is out of range/n", CodePoint);            continue;        }        /* catchup? */        while (i < CodePoint)            NullEntry(i++);        if (i != CodePoint)        {            ParseError("i=%d CodePoint=%u/n", i, CodePoint);            CloseFile(pFile);            return 1;        }        /* this one */        g_aCPInfo[i].CodePoint = i;        g_aCPInfo[i].fNullEntry = 0;        g_aCPInfo[i].pszName                    = DupStr(pszName);        g_aCPInfo[i].SimpleUpperCaseMapping     = ToNumDefault(pszSimpleUpperCaseMapping, CodePoint);        g_aCPInfo[i].SimpleLowerCaseMapping     = ToNumDefault(pszSimpleLowerCaseMapping, CodePoint);        g_aCPInfo[i].SimpleTitleCaseMapping     = ToNumDefault(pszSimpleTitleCaseMapping, CodePoint);        g_aCPInfo[i].CanonicalCombiningClass    = ToNum(pszCanonicalCombiningClass);        g_aCPInfo[i].pszDecompositionType       = DupStr(pszDecompositionType);        g_aCPInfo[i].paDecompositionMapping     = ToMapping(pszDecompositionMapping, &g_aCPInfo[i].cDecompositionMapping, 20);        g_aCPInfo[i].pszGeneralCategory         = DupStr(pszGeneralCategory);        g_aCPInfo[i].pszBidiClass               = DupStr(pszBidiClass);        g_aCPInfo[i].pszNumericType             = DupStr(pszNumericType);        g_aCPInfo[i].pszNumericValueD           = DupStr(pszNumericValueD);        g_aCPInfo[i].pszNumericValueN           = DupStr(pszNumericValueN);        g_aCPInfo[i].pszBidiMirrored            = DupStr(pszBidiMirrored);        g_aCPInfo[i].pszUnicode1Name            = DupStr(pszUnicode1Name);        g_aCPInfo[i].pszISOComment              = DupStr(pszISOComment);        i++;    }    /* catchup? */    while (i < RT_ELEMENTS(g_aCPInfo))        NullEntry(i++);    CloseFile(pFile);    return 0;}
开发者ID:stefano-garzarella,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:89,



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


C++ CloseHandle函数代码示例
C++ CloseDialog函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。