![]() |
Filestream - Add a File to an other File
hy,
i have the following problems. i have a txt and a dll file. now i want that the dll file will add at the end of the txt file. i mean that i want to insert a dll file in a txt file at the end. i have tried it with a filestream. but it doesnt do it what it should. can someone post a function ? thanks... |
Re: Filestream - Add a File to an other File
I got no idea why anyone wants to do, what you want to do, however, you should show us your code and we will be able to help you to fix it ;)
...:cat:... |
Re: Filestream - Add a File to an other File
okay,
this is my code: it should add a dll file to an other file.
Delphi-Quellcode:
where is the error or can you fix it ?
var
fs,fs2 : TFileStream; Buffer: Pointer; Buffer2: Pointer; filename: string; begin if OpenDialog1.Execute then filename := OpenDialog1.FileName; fs := TFileStream.Create(filename, fmOpenReadWrite); fs.ReadBuffer(Buffer^,Sizeof(Buffer^)); fs.Seek(0,soFromEnd); fs2 := TFilestream.Create('sf_wrapper.dll', fmOpenRead); fs2.ReadBuffer(Buffer2^,Sizeof(Buffer2^)); fs.WriteBuffer(Buffer2^,Sizeof(Buffer2^)); fs.Free; fs2.Free; [edit=sakura] No pushing within 48 hours :!: Mfg, sakura[/edit] |
Re: Filestream - Add a File to an other File
Althoug I don't know for what reason you might need this, here's my answer :zwinker:
Zitat:
Delphi-Quellcode:
(By the way: there were a few 'errors' in your code :wink:, e.g. you don't need to read sth. from FS.)
var
fs,fs2 : TFileStream; begin if OpenDialog1.Execute then try fs := TFileStream.Create(OpenDialog1.FileName, fmOpenReadWrite); fs2 := TFilestream.Create('myDLL.dll', fmOpenRead); fs.Seek (fs.Size,soFromBeginning); fs2.Seek(0, soFromBeginning); fs.CopyFrom(fs2,fs2.Size); finally fs.Free; fs2.Free; end; end; Greetz Stephan |
Re: Filestream - Add a File to an other File
Look for my class
![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:42 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz