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.
I was trying to read a file with readSting() method. Below is my code
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.