projects
/
ghc-hetmet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[project @ 1996-07-26 20:58:52 by partain]
[ghc-hetmet.git]
/
ghc
/
misc
/
examples
/
io
/
io013
/
Main.hs
1
import IO -- 1.3
2
3
main =
4
openFile "io013.in" ReadMode >>= \ h ->
5
hFileSize h >>= \ sz ->
6
print sz >>
7
hSeek h SeekFromEnd (-3) >>
8
hGetChar h >>= \ x ->
9
putStr (x:"\n") >>
10
hSeek h RelativeSeek (-2) >>
11
hGetChar h >>= \ w ->
12
putStr (w:"\n") >>
13
hIsSeekable h >>= \ True ->
14
hClose h >>
15
openFile "/dev/null" ReadMode >>= \ h ->
16
hIsSeekable h >>= \ False ->
17
hClose h