Skip to content

"file read error" in log viewer when opening a csv file on windows10 64bit LTSC with ngscopeclient v0.1 github release build #1002

@wchgod001-gh

Description

@wchgod001-gh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfilterFilter graph blocksportabilityThings that break on some OS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions