1. Technology
Send to a Friend via Email
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

ForceDirectories

unit
FileCtrl
category
file management routines

declaration
function ForceDirectories(FolderPath: string): boolean;

description
Creates all the folders along a given path.

The ForceDirectories function creates a directory and all sub-directories that do not already exist. The function returns False if sDir is an empty string or a bad path name, True if succesfull.

example
var sDir : string;

sDir := 'c:\apps\code\free';;

//if sDir path does not exist, create it!
if NOT DirectoryExists(sDir) then
  ForceDirectories(sDir);

in real code

see also
GetCurrentDir, DirectoryExists


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2014 About.com. All rights reserved.