void Disk_Thread::OpenFilesForDownload(void) { char Str[VFS_INODEN_NAME_LEN+5]={0}; VFS_OpenFile(&VFSHandler, ActFile->EntryName ,O_RDWR); if(pFileDownload->type == TS_DOWNLOAD){ snprintf(Str,VFS_INODEN_NAME_LEN+5,"%s.mpg",ActFile->EntryName); }else if(pFileDownload->type == REC_DOWNLOAD){ snprintf(Str,VFS_INODEN_NAME_LEN+5,"%s.rec",ActFile->EntryName); } stripCtrlE((char *)Str); printf(" try to open %s\n",Str); prepareFileName(Str); PCFile = new QFile(Str); if(!PCFile->open(QIODevice::ReadWrite)){ delete PCFile; ActFile = 0; printf(" can't open file\n"); } else if (pFileDownload->type == REC_DOWNLOAD) { // Write REC file header char Epg[512] = {0}; HD_VFS_PC_HEADER* pPC_Header = (HD_VFS_PC_HEADER*) malloc(sizeof(HD_VFS_PC_HEADER)); memset(pPC_Header->ver,0x00,sizeof(pPC_Header->ver)); memset(pPC_Header->Epg,0x00,sizeof(pPC_Header->Epg)); HD_VFS_GetEventInfobyFileIDX(VFSHandler->EntryIDX, (INT8U *)Epg); memcpy(pPC_Header->Epg,Epg,512); memset(pPC_Header->MarkInfo,0x00,sizeof(pPC_Header->MarkInfo)); snprintf((char*)pPC_Header->ver,VFS_PC_VERSION_STR_LEN,"%s",VFS_PC_ACTVERSION); printf(" -> %s \n",pPC_Header->ver); PCFile->write((const char*)pPC_Header,sizeof(HD_VFS_PC_HEADER)); free(pPC_Header); } }
void Crosspointer::openSRFile() { prepareFileName(); file = fopen(fileName, "rb"); if(file == NULL) exitWithMsg("Error opening special row file.", -1); fread(specialRow, sizeof(int2), query->getSecond()->getPaddedLength(), file); fclose(file); }
void ArchiverService::createBackup() { prepareArchiveDir(); QString filePrefix = QCoreApplication::applicationName().toLower().trimmed().replace(" ", "_"); prepareFileName(filePrefix, "dump"); archivePath = ArchiverService::ARCHIVE_DIR + QDir::separator() + this->fileName; this->callDumpingProcess(); }