| filename file numOfLines isFollowMode lineCount savedPosition | filename := 'in.txt'. numOfLines := 10. isFollowMode := false. file := FileStream fileNamed: filename. file setToEnd. file binary. lineCount := 0. [file position > 0 and: [lineCount < numOfLines]] whileTrue: [file back = 13 ifTrue: [lineCount := lineCount + 1]]. file ascii. World findATranscript: nil. Transcript cr; show: file upToEnd. savedPosition := file position. file close. isFollowMode ifTrue: [ [Sensor keyboardPressed] whileFalse: [ (Delay forSeconds: 5) wait. file reopen; position: savedPosition. Transcript show: file upToEnd. savedPosition := file position. file close]]