mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-01 18:30:05 +02:00
rxr: remove file buffering
This commit is contained in:
parent
c42b4b8c0e
commit
af2f2708ad
@ -196,10 +196,9 @@ class BinaryFileStatic {
|
|||||||
* @param fd file pointer
|
* @param fd file pointer
|
||||||
* @param owenable overwrite enable
|
* @param owenable overwrite enable
|
||||||
* @param fname complete file name
|
* @param fname complete file name
|
||||||
* @param filebuffersize file buffer size
|
|
||||||
* @returns 0 for success and 1 for fail
|
* @returns 0 for success and 1 for fail
|
||||||
*/
|
*/
|
||||||
static void CreateDataFile(FILE*& fd, bool owenable, std::string fname, size_t filebuffersize)
|
static void CreateDataFile(FILE*& fd, bool owenable, std::string fname)
|
||||||
{
|
{
|
||||||
if(!owenable){
|
if(!owenable){
|
||||||
if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){
|
if (NULL == (fd = fopen((const char *) fname.c_str(), "wx"))){
|
||||||
@ -210,8 +209,8 @@ class BinaryFileStatic {
|
|||||||
fd = 0;
|
fd = 0;
|
||||||
throw sls::RuntimeError("Could not create file " + fname);
|
throw sls::RuntimeError("Could not create file " + fname);
|
||||||
}
|
}
|
||||||
//setting file buffer size to 16mb
|
//setting to no file buffering
|
||||||
setvbuf(fd,NULL,_IOFBF,filebuffersize);
|
setvbuf(fd, NULL, _IONBF, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -49,7 +49,7 @@ void BinaryFile::CreateFile() {
|
|||||||
currentFileName = BinaryFileStatic::CreateFileName(*filePath, *fileNamePrefix, *fileIndex,
|
currentFileName = BinaryFileStatic::CreateFileName(*filePath, *fileNamePrefix, *fileIndex,
|
||||||
subFileIndex, *detIndex, *numUnitsPerDetector, index);
|
subFileIndex, *detIndex, *numUnitsPerDetector, index);
|
||||||
|
|
||||||
BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName, FILE_BUFFER_SIZE);
|
BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName);
|
||||||
|
|
||||||
if(!(*silentMode)) {
|
if(!(*silentMode)) {
|
||||||
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user