W Writer Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-20 #2 “二进制文件”什么东东?文件没有分多少进的呀。 如果要读取任何文件的倒数N字节,并存为文件就可以。
W Writer Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-21 #4 var ; FS1, FS2: TFileStream; ; C: Char; ; n: Integer; begin ; FS1 := TFileStream.Create('C:/001.exe', fmOpenRead); ; FS2 := TFileStream.Create('C:/001.txt', fmCreate); ; n := 1; ; FS1.Seek(n, 0); ; FS1.Read(C, 1); ; FS2.Write(C,1); ; FS1.Free; ; FS2.Free; end;
var ; FS1, FS2: TFileStream; ; C: Char; ; n: Integer; begin ; FS1 := TFileStream.Create('C:/001.exe', fmOpenRead); ; FS2 := TFileStream.Create('C:/001.txt', fmCreate); ; n := 1; ; FS1.Seek(n, 0); ; FS1.Read(C, 1); ; FS2.Write(C,1); ; FS1.Free; ; FS2.Free; end;
P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-21 #5 var ; fh:integer; ; buf:array[0..n-1]of char; begin fh:=_lopen('原来的文件',OF_READ); _llseek(fh,0-n,FILE_END); _lread(fh,@buf,n); _lclose(fh); fh:=_lcreat('新文件',0); _lwrite(fh,@buf,n); _lclose(fh); end;
var ; fh:integer; ; buf:array[0..n-1]of char; begin fh:=_lopen('原来的文件',OF_READ); _llseek(fh,0-n,FILE_END); _lread(fh,@buf,n); _lclose(fh); fh:=_lcreat('新文件',0); _lwrite(fh,@buf,n); _lclose(fh); end;