[File] writeBytes: [String]. | Manual

[File] writeBytes: [String].

Takes a string and writes the bytes in the string to the file object. Returns the number of bytes actually written.

 f := File new: '/path/to/file.txt'.
 f open: 'r+'.
 n := f writeBytes: 'Hello World'.
 f close.

 The example above writes 'Hello World' to the specified file as bytes.
 The number of bytes written is returned in variable n.

back to homepage
back to manual menu

This API reference guide has been generated automatically from source code comments using the shtml.ctr script.