.------------------------------------------------------------------------------
.-
.-  testfile.gsl - Test file GSL functions
.-
.------------------------------------------------------------------------------

in  = file.open ("testfile.gsl", "r")
s = ""
xline = file.read (in)
while defined (xline)
    s += xline + "\n"
    xline = file.read (in)?
endwhile
ret = file.close (in)

out = file.open ("testfile.out", "w")
ret = file.write (out, s)
ret = file.close (out)

echo "Expect YES:"
if file.locate ("testfile.gsl") <> ""
    echo "YES"
else
    echo "NO"
endif

echo "Expect NO:"
if file.locate ("testfile.xxx") ?<> ""
    echo "YES"
else
    echo "NO"
endif

echo "Expect file not found error:"
in = file.open ("testfile.xxx") ?
echo file.error

echo "Expect YES:"
if file.basename ("testfile.gsl") = "testfile"
    echo "YES"
else
    echo "NO"
endif

