Toon posts:

[delphi] controleren of een directory bestaat!

Pagina: 1
Acties:
  • 88 views sinds 30-01-2008

Verwijderd

Topicstarter
Hoi.,


Hoe moet ik controleren of een directory bestaat! als ie niet bestaat moet ie worden aangemaakt!!
Als ie wel bestaat dan moet er niks gebeuren!!


Groeten, Ruud

Verwijderd

FindFirst searches for the first instance of a file name with a given set of attributes in a specified directory.

Unit

SysUtils

Category

file management routines

function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer;

Description

FindFirst searches the directory specified by Path for the first file that matches the file name implied by Path and the attributes specified by the Attr parameter. The result is returned in the F parameter. Use the fields of this search record to extract the information needed. FindFirst returns 0 if a file was successfully located, otherwise, it returns a Windows error code.

The Path constant parameter is the directory and file name mask, including wildcard characters. For example, 'c:\test\*.*' specifies all files in the C:\TEST directory).

The Attr parameter specifies the special files to include in addition to all normal files. Choose from these file attribute constants when specifying the Attr parameter:

ConstantValueDescription
faReadOnly$00000001Read-only files
faHidden$00000002Hidden files
faSysFile$00000004System files
faVolumeID$00000008Volume ID files
faDirectory$00000010Directory files
faArchive$00000020Archive files
faAnyFile$0000003FAny file
Attributes can be combined by adding their constants or values. For example, to search for read-only and hidden files in addition to normal files, pass (faReadOnly + faHidden) the Attr parameter.

Note

The FindFirst function allocates resources (memory) which must be released by calling FindClose.


JE MOET EERST IN DE HELP KIJKEN VOORDAT JE WAT VRAAGT :(

Verwijderd

Topicstarter
nee nu snap ik het :(:(:(:(:((:
Niet dus!

  • Elissen
  • Registratie: Januari 2000
  • Laatst online: 27-07 15:54
RTFM:

if not DirectoryExists('c:\temp') then
.........


P.S. Werkt niet altijd goed bij gebruik van UNC namen (\\server\share).

Verwijderd

Topicstarter
en hoe maak ik een directory?

;)

  • Bergen
  • Registratie: Maart 2001
  • Laatst online: 18-08 10:58

Bergen

Spellingscontroleur

RTFM man... :'( is dat zou zo moeilijk... gewoon in de Help->Find "Directory Create" intypen... duh. Anyway:

Unit

SysUtils
CreateDir creates a new directory.

function CreateDir(const Dir: string): Boolean;

Description

The CreateDir function creates a new directory. The return value is True if a new directory was successfully created, or False if an error occurred.

  • Gerco
  • Registratie: Mei 2000
  • Laatst online: 24-08 19:16

Gerco

Professional Newbie

Is dit nu zo'n RTFM vraag?

- "Als ik zou willen dat je het begreep, legde ik het wel beter uit!" | All number systems are base 10!


  • brid
  • Registratie: Januari 2001
  • Laatst online: 30-07 16:21

brid

Onze excuses voor het ongemak

Nee jo. :)
Dit id geen RTFM vraag het is eigenlijk nog een stap erger :) iets als RTFFFFFFM

DIY NAS, Hoofd PC
Unchain your pc/laptop, buy a SSD!!!!!


Verwijderd

Pest die jongen nou niet zo ;)

Kan hij er wat aan doen dat hij gebrek aan eigen initiatief vertoond >:)

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

Op dinsdag 05 juni 2001 20:59 schreef ruud_k het volgende:
en hoe maak ik een directory?

;)
Een post als dat verhoogt de geloofwaardigheid van je probleem niet echt.

En het is nu wel weer lekker offtopic aan het gaan. (Daarom het slot)
Pagina: 1

Dit topic is gesloten.