Hi, Due to fast SEEK method of FILE object I need store some data into temporary file. But, what made me anger is that LEN method absolutelly doesn’t work with unsaved file (temporary or not yet saved file). LEN returned value only if you write more than 2048B and return value is always multuple of 2048B. WITH FileHandler DO BEGIN TEXTMODE(FALSE); CREATETEMPFILE; //OR OPEN(‘c:\example.txt’); FOR i := 1 TO 512(513,1024,1025, …) DO WRITE(1); //Int ~ 4B MESSAGE(’%1’,LEN); END; write (B) return value 0…2048 0 2049…4096 2048 4097… 4096 and so on … Is there any way to obtain LEN of this type of file (why there is no similarity to InStream object with its EOS f.e. EOF) ? Thanks a lot for your answer.
I’m not quite clear on what you are asking, but your current position (File.POS) should have the total length of the file if you do not use the seek command. File.POS should return the last position you wrote.