Generic FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

file-character-position

Arguments: simple-stream

This generic function tries to determine the character position of its simple-stream argument, similar to stream-line-column which tries to determine the character number from the beginning of a line. The value returned is a non-negative integer or nil.

The first character in a file has character position 0 (following Lisp practice of numbering things starting at 0). Some editors (Emacs being an example) consider the character position of the first character to be 1. So Emacs command "M-x goto-char 2 1 RET" goes to character position 20. Emacs users and users of other editors which consider the first character to have position 1 should take this difference into account.

nil means that the value cannot be determined. This can happen, for example, if bytes rather than characters have been read from simple-stream or the file-position has been set. Unlike stream-line-column, which can re-synchronize itself after reading a newline, file-character-position cannot; it can only re-synchronize itself when the file-position starts at zero and only characters are read.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version