Short file reported as too long
Status: Beta
Brought to you by:
worden
Please see http://lalashan.mcmaster.ca/theobio/projects/index.php/Parse. The .csv file is 3B long, but WW reports it is "too large for display".
Anonymous
I'm also seeing a related issue, which is that when a file's too large,
it shouldn't refer you to a GetProjectFile page that will just tell you
the same thing, it should just give you the download link. I'll see if
I can fix both things easily.
That's kind of weird :) Looking into it.
fixed the download link. working on the original problem.
turns out the cause is sort of embarassing. the find_file_contents() function returns the content of the file it's asked for, or -1 in case the file is too large. in this case, the content of the file is the string "-1", so it's a false positive, so to speak.
Solution: -1 is not an appropriate flag, since it can be a legitimate return value. Use an exception instead.
Update: I changed the flag from -1 to something much less likely to arise as a false positive. So it's okay for now. Leaving open though because it's still a bug.