Hello. We are trying to read a JLD file directly. However, the @code_warntype gives warning that the returned result of read() is ::Any, and consequently the length of the string is also ::Any. So we guess the problem is how to specify the type of the read result. Is there anyway?
function test_JLD()
file = jldopen( "test.jld", "r" )
for index in 1:4
test_str = read( file, "test$index" )
len = length(test_str)
if len > 125
println( "too long" )
end # if
end # for index
close(file)
return nothing
end # function test_JLD
@code_warntype test_JLD()
As you can see the test_str::Any and len::Any are warned. Also the file variable, which is in the for loop, is warned file::Union{JLD.JldFile, JLD.JLD00.JldFile}.
Hello. We are trying to read a JLD file directly. However, the @code_warntype gives warning that the returned result of read() is ::Any, and consequently the length of the string is also ::Any. So we guess the problem is how to specify the type of the read result. Is there anyway?
And here is the message from @code_warntype
As you can see the test_str::Any and len::Any are warned. Also the
file
variable, which is in the for loop, is warned file::Union{JLD.JldFile, JLD.JLD00.JldFile}.