Buffer overflow using textscan happens in windows but not in mac

4 views (last 30 days)
Hi there,
I'm using textscan to import a big JSON file with the following line:
MyString = textscan(fid, '%s','Headerlines',0,'Delimiter','!','CollectOutput',1,'EndOfLine','\n','BufSize',50*1024*1024);
As you see, I use textscan to read the file in a single string, because I need to parse it. The file has 43 MB.
Setting the BufSize to 50 MB will make the import work in windows 7. But under Mac, setting the BufSize to 2 MB is enough and the program will work.
Why are there such differences between mac and win? thanks

Answers (1)

Jan
Jan on 3 Apr 2012
This is a question for the technical support, because the source codes of textscan are not public.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!