function [s,ok] = readfile( fname )
    ok = false;
    fid = fopen( fname, 'r' );
    s = '';
    if fid==-1
        return;
    end
    while true
        s1 = fgets( fid );
        if s1==-1, break; end
        s = [ s, s1 ];
    end
    fclose( fid );
    ok = true;
end