![]() |
||
|
|
#1 (permalink) |
|
Dostaki deltree komutu
procedure TForm1.DelTree(const DirName: string); var { This procedure uses recursive calls to traverse directory structures, so pointers are used to keep stack usage to a minimum } SearchRec: ^TSearchRec; FileName: PString; GotOne: Integer; begin if trim(DirName)=" then exit; { Disable input/output checking } {$I-} { Allocate new TSearchRec record and a new FileName string } New(SearchRec); New(FileName); try GotOne := FindFirst(DirName + '\*.*', faAnyFile, SearchRec^); while (GotOne = 0) do begin with SearchRec^ do begin FileName^ := DirName + '\' + Name; { Is the current file a directory? } if ((Attr and faDirectory) = 0) then begin { The current file is not a directory. Delete it if it's not a system or volume ID file } if ((Attr and (faSysFile or faVolumeID)) = 0) then begin { Change the file's attributes if it's marked as read-only } if ((Attr and faReadOnly) <> 0) then FileSetAttr(FileName^, FileGetAttr(FileName^) and (not faReadOnly)); DeleteFile(FileName^); end; { end if } end else if ((Name <> '.') and (Name <> '..')) then { The current file is a directory. Call ourselves recursively so that we traverse the sub directory structure } DelTree(FileName^); end; { end with } GotOne := FindNext(SearchRec^); end; { end while } FindClose(SearchRec^); RmDir(DirName); finally { Dispose of the memory allocate for the TSearchRec record and FileName string } Dispose(FileName); Dispose(SearchRec); end; { end try } { Re-enable input/output checking } {$I+} end; --------------------------------------------------------------------------------------------------------- Altın harflerle yaz mahlasımı. halvetim kasvet, kem gözlere şiş!... Cadü ya herru!...ya merru!...kafkef, gölge harâmilerine bir selam çak!... Abile ğatladı, demlenir simam, nüşinrevan'dan handan ummam ben. Ahu-yi felek mum, ben şamdan. düşmez kalkmaz bir Allah'tır uyan!... |
|
|
|
|
| Sayfayı E-Mail olarak gönder |
| Sponsorumuz |
![]() |
| Bookmarks | |||||||||||||
Facebook
|
Google
|
Yahoo
|
Live
|
Digg
|
Reddit
|
del.icio.us
|
StumbleUpon
|
Bluedot
|
Blinklist
|
Netvouz
|
Spurl
|
Mister-Wong
|
Furl
|
| Tags |
| deltree... |
| Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| Seçenekler | |
| Stil | |
|
|