CountBytes - Maple Help

FileTools[Binary]

 CountBytes
 count the total number of bytes left in a file

 Calling Sequence CountBytes(file)

Parameters

 file - file descriptor or filename

Description

 • The CountBytes(file) command counts the number of bytes from file's current position to the end of the file.
 • An error is raised if file is not a valid descriptor or if the filename does not exist.

Examples

 > $\mathrm{FileTools}\left[\mathrm{Binary}\right]\left[\mathrm{Write}\right]\left("foo",\mathrm{integer}\left[1\right],\left[1,2,3,4,5,6,7,8,9,0\right]\right):$
 > $\mathrm{FileTools}\left[\mathrm{Binary}\right]\left[\mathrm{Close}\right]\left("foo"\right):$
 > $\mathrm{FileTools}\left[\mathrm{Binary}\right]\left[\mathrm{CountBytes}\right]\left("foo"\right)$
 ${10}$ (1)
 > $\mathrm{FileTools}\left[\mathrm{Position}\right]\left("foo",4\right):$
 > $\mathrm{FileTools}\left[\mathrm{Binary}\right]\left[\mathrm{CountBytes}\right]\left("foo"\right)$
 ${6}$ (2)
 > $\mathrm{FileTools}\left[\mathrm{Remove}\right]\left("foo"\right):$