Arsip: copy file dengan parameter date modified
more 17 years ago
jagur
Bro... tulung dong
gmn copy paste file tertentu ke folder tertentu dengan filter date modified file tadi
tks b4 :?:
more 17 years ago
ZeAL
kalo copy biasa, pake fungsi CopyFile.. di search aja.. dah sering di bahas..
Kalo ngerubah file date, kalo gak salah pake fungsi FileAttrib.. eh..err.. apa yah untuk ngerubah tanggal... Coba yang diinstal Delphi di kompi nya, teken F1.. hehehe..
more 17 years ago
mas_kofa
dari post @zeal...........
1. file kita cek file date dgn fungsi FileAttrib......
2. jika date sesuai yg diinginkan maka copy file tersebutCopyFile.........
more 17 years ago
Yudho
WAH. Apaan lagi Itu FileAttrib ...
gak mudeng blas aku.
Kalau boleh tahu, minta penjelasanya dong? hehehehee
Trim's
more 17 years ago
jagur
nih bro yudho ... scodenya buat find file
procedure TfrMain.FileSearch(const PathName, FileName : string; const InDir : boolean; FileDate: TDateTime);
var Rec : TSearchRec;
Path : string;
begin
Path := IncludeTrailingBackslash(PathName);
if FindFirst(Path + FileName, faAnyFile - faDirectory, Rec) = 0 then
try
repeat
// tambahin filter Tanggal
if (FileDateToDateTime(Rec.Time) < FileDate) then
lbFile.Items.Add(Path + Rec.Name);
until FindNext(Rec) <> 0;
finally
FindClose(Rec);
end;
If not InDir then Exit;
if FindFirst(Path + '. ', faDirectory, Rec) = 0 then
try
repeat
// tambahin filter Tanggal
if ((Rec.Attr and faDirectory) <> 0) and (Rec.Name<>'.') and (Rec.Name<>'..') and (FileDateToDateTime(Rec.Time) < FileDate) then
FileSearch(Path + Rec.Name, FileName, True,FileDate);
until FindNext(Rec) <> 0;
finally
FindClose(Rec);
end;
end; //procedure FileSearch
more 16 years ago
sidiq_himura
tolong dong gimana kalaw saya maw simpen file'a lewat network
jadi filenya saya simpen ke server, saya sudah coba langsung di tujukan ke ip adress'a tapi belum berhasil
mohon pencerahannya
more 16 years ago
DelphiExpert
thread lama mengambang lagi :mrgreen:
@sidiq_himura:
1. gunakan standard fungsi copy ke network address, artinya harus ada folder yg di share dng write privilege
2. buat program kecil2an sebagai FTP listener (FTP server), taruh ditarget komputer. upload/download via FTP protokol, atau kalau mau, bisa bikin protokol sendiri berbasis TCP/(UDP?)
more 16 years ago
alvonz
saya dapet contoh source copyfile dari tips n trik kali aja bermanfaat:
function TInstallForm.CopyFileUsingBuffer(srcFName, destFName: String): Boolean;
type
{define a buffer as a character array type of length maxBufferSize...}
TMyBufferArray = array of char;
{and define a pointer type to point into the buffer...}
TMyBuffer = ^TMyBufferArray;
var
buffer: TMyBuffer;
srcFile, destFile: File;
bytesRead, bytesWritten, i: LongInt;
readOrWriteError: Boolean;
begin
bytesRead := 0;
try {to allocate memory for the buffer...}
getmem(buffer, maxBufferSize);
AssignFile(srcFile, srcFName);
AssignFile(destFile, destFName);
try {to open both source and destination files...}
reSet(srcFile, 1);
reWrite(destFile, 1);
try
repeat
{put source file data into into the buffer
and write buffer to destination file...}
blockRead(srcFile, buffer^, sizeof(buffer^), bytesRead);
blockWrite(destFile, buffer^, bytesRead, bytesWritten);
until ((bytesRead < maxBufferSize) or (bytesRead = 0)
or (bytesWritten <> bytesRead));
finally
closefile(srcFile);
closeFile(destFile);
end; {putting source file data into memory}
except on E: EInOutError do
begin
{you COULD call some kind of GetError routine here
to retrieve the exact error code if you wanted to...}
readOrWriteError := True;
end
end; {trying to open source file}
finally
freemem(buffer, maxBufferSize);
end;
if (readOrWriteError = True) then Result := True;
if (readOrWriteError = False) then Result := False;
end;
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- [HELPP ]Tanya cara set Regional Option dari script dong
by MingMing in Tip n Trik Pemrograman more 18 years ago - MErdeka
by nurez in OOT more 17 years ago - minta saran pengembangan software knowledge management
by kenjiro in Hal umum tentang Pascal Indonesia more 18 years ago - yang taw cara download nexia emulator (offlline)
by gunicer in Games more 17 years ago - Interface MSSQL di client
by xmbohx in MsSQL more 17 years ago - detect hidden process
by xerion in Tip n Trik Pemrograman more 17 years ago - Belajar DB apa ya?
by _lmz in MySQL more 18 years ago - Generate even
by delphicode in Tutorial & Community Project more 15 years ago - Crystal Report pada Delphi 7
by shindo in Hal umum tentang Pascal Indonesia more 17 years ago - [request] form master detail ADO-Ms Access
by siLupus in Hal umum tentang Pascal Indonesia more 18 years ago