DSOM
asked on
stream read error when copying from memory stream to file stream
I have a tmemorystream and I want to copy it to a tfilestream but I am getting stream read error.
quick and dirty example:
new.stream:=tfilestream.Cr eate('c:\t emp.tmp', fmcreate);
new.stream.copyfrom(memstr eam, memstream.size);
Shouldn't this copy the contents of memstream to the filestream?
quick and dirty example:
new.stream:=tfilestream.Cr
new.stream.copyfrom(memstr
Shouldn't this copy the contents of memstream to the filestream?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks TheRealLoki, that was the problem!
I understand that if it do not exists, the function only creates it but do not open it.
You should call
tfilestream.Create('c:\tem
or
tfilestream.Create('c:\tem
Something like this.
Hope this help!!