Get EOF character


M

Manish Hatwalne

I sit possible to get an EOF character for a plain text file (^Z etc) in my
Java code using some system property (something like "file.separator").
I know how to read file, but I need this EOF character for some other
purpose. How can I get this?

TIA,
- Manish
 
Ad

Advertisements

C

Carl Howells

Manish said:
I sit possible to get an EOF character for a plain text file (^Z etc) in my
Java code using some system property (something like "file.separator").
I know how to read file, but I need this EOF character for some other
purpose. How can I get this?

TIA,
- Manish

There's no such thing as an EOF character. The end of a file isn't
marked by any kind of special character. The end of the file is
determined by the entry in the file system that stores the length of the
file.

You'll have to find a different way to solve the problem. Do you want
multiple files? Do you want a single file with multiple sections?
 
M

Manish Hatwalne

BTW, I tried this and found that there's no system property as such, is
there any other way of getting it?
System.getProperties().list(System.out);

TIA,
- Manish
 
R

Roedy Green

I sit possible to get an EOF character for a plain text file (^Z etc) in my
Java code using some system property (something like "file.separator").
I know how to read file, but I need this EOF character for some other
purpose. How can I get this?

public static final char EOF = (char)26;
 
R

Roedy Green

BTW, I tried this and found that there's no system property as such, is
there any other way of getting it?
System.getProperties().list(System.out);

the EOF character has no special meaning in Java. It did in CPM and
sometimes in DOS, but generally it is not used anymore. The OS tracks
the exact length of a file and puts no marker character in.
 
Ad

Advertisements


Top