All I need to do is copy a file from one location to another and back again every hour.
What I would like to do is open a text file into a memo box and then save the contents of the memo box into a separate file. Then every hour i want the same to happen again (to update the file) but then save it back to the original file.
My solution so far:
if FileExists('D:\games\RedFaction\banlist.txt') then begin AssignFile(F, 'D:\games\RedFaction\banlist.txt'); Reset(F); ReadLn(F, S); Memo1.Lines.Add(S); end else ShowMessage('File C:\Hello.txt not found'); end; end.
As you can probably see this adds only one line of the file to my memo box. This is no good. I need the whole file added so it can then be saved.
Also the file will constantly grow in lines so the app. has to be able to cope with this. My method would involve have allot of ReadLn(F, S); Memo1.Lines.Add(S); extra in the code to ensure that no lines are missed. Its a really bad solution but the only one i can think of.
pseudo ensure file is there load file into a variable write variable to a memo box save contents of memo box to an alternate location read file from the alternate location into a variable write variable to a memo box save contents of memo box to the original location