Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
FileDirectory example: write a file
Last updated at 5:32 pm UTC on 27 May 2016
Assuming you are running a Squeak "All-in-one" distribution the following code writes a file 'hello.txt' to the directory where the 'All-in-one' folder is

 | output |
 output _  FileStream fileNamed: 
         (FileDirectory default containingDirectory containingDirectory  fullNameFor:  'hello.txt').
 output nextPutAll: 'line1'.
 output cr.
 output nextPutAll: 'line2'.
 output close.