i can successfully opening .bin file (saved from a keysight scope), but failed to open a .csv file ( saved from a dreamsouce scope, manually modified, as it's data format is not directly supported ).
i have compared the code for file opening in lib\scopeprotocols\CSVImportFilter.cpp and lib\scopeprotocols\BINImportFilter.cpp, it's the same.
and tried to extract this piece of code into a cpp file, compiled and executed successfully with no error.
//Read the entire file into a buffer
FILE* fp = fopen(fname.c_str(), "r");
if(!fp)
{
LogError("Couldn't open CSV file \"%s\"\n", fname.c_str());
return;
}
fseek(fp, 0, SEEK_END);
size_t flen = ftell(fp);
fseek(fp, 0, SEEK_SET);
char* buf = new char[flen+1];
if(flen != fread(buf, 1, flen, fp))
{
LogError("file read error\n");
return;
}
buf[flen] = '\0'; //guarantee null termination at end of file
fclose(fp);
i guess the content of this csv file is not relevant, what could possibly be wrong?
out-100line.csv