Quoting Kris Leech <[EMAIL PROTECTED]>:
Is it possible to convert a memory byte stream (eg. TFileStream) in to
a File pointer for use with normal file routines?
Quick-Easy Answer:
No. Any class (like "TFileStream") is stored different in memory that
a File type.
Long-Difficult-Boring Answer:
We call, sometimes, a File variable a "pointer" in terms of a concept.
But, a File variable, speaking technically, isn't a pointer but a
record.
Suggestion:
Why don't you use a "TFileStream" and its methods instead ?
Or if you prefer, you may make your own "unit", in order to use a
"TFileStream" variable/object as it was a "File" variable and the
methods you are use to.
Example:
---------------------------
Unit MyFileUnit;
interface
type
TMyFile = TFileStream;
procedure Assign(var F: TMyFile; FullPath: string);
procedure Reset(var F: TMyFile; RecordSize: Integer);
procedure Rewrite(var F: TMyFile; RecordSize: Integer);
procedure Append(var F: TMyFile; RecordSize: Integer);
procedure Close(var F: TMyFile);
implementation
procedure Assign(var F: TMyFile; FullPath: string);
begin
...
end;
procedure Reset(var F: TMyFile; RecordSize: Integer);
begin
...
end;
procedure Rewrite(var F: TMyFile; RecordSize: Integer);
begin
...
end;
procedure Append(var F: TMyFile; RecordSize: Integer);
begin
...
end;
procedure Close(var F: TMyFile);
begin
...
end;
end.
---------------------------
Just my 2 cents.
maramirez
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives