read 0 blocks instead of 1 at /export/home/jkhurana/torch/pkg/torch/lib/TH/THDiskFile.c:563
jKhurana opened this issue · 1 comments
jKhurana commented
I was trying to read a file with readSting() method. Below is my code
require 'torch'
require 'pl'
local f = torch.DiskFile('train')
f:clearError()
local rawdata = f:readString('*l')
while (not f:hasError()) do
print(rawdata)
rawdata = f:readString('*l')
end
First it reads all the lines of file and at last gives the following error
read 0 blocks instead of 1 at /export/home/jkhurana/torch/pkg/torch/lib/TH/THDiskFile.c:563
I can not use io.read() as I have to serialise the content later.
jKhurana commented
Problem is solved. My file was not in quite() mode.