Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.04.30;
Скачать: CL | DM;

Вниз

Создание не одной папки,а целого пути.   Найти похожие ветки 

 
OlegOren   (2006-04-13 10:36) [0]

Возможно и поднималсь эта тема в форуме, но я не нашел.
Если эта темя есть просто дайте ссылку, если нет то  помогите найти хорошее рашение.
Суть: фнк. CreateDir("C:\1\") - cjplftn yf lbcrt gfgre "1"
Вопрос: как создать петь "c:\1\2\3\" ?


 
Старик   (2006-04-13 10:44) [1]

ForceDirectories("c:\1\2\3\")


 
Чапаев ©   (2006-04-13 10:46) [2]

ForceDirectories function
Creates a new directory, including the creation of parent directories as needed.

Unit

SysUtils

Category

file management routines

Delphi syntax:

function ForceDirectories(Dir: string): Boolean;

C++ syntax:

extern PACKAGE bool __fastcall ForceDirectories(AnsiString Dir);

Description

ForceDirectories creates a new directory as specified in Dir, which must be a fully-qualified path name. If the directories given in the path do not yet exist, ForceDirectories attempts to create them.

ForceDirectories returns true if it successfully creates all necessary directories, false if it could not create a needed directory.

Important: Do not call ForceDirectories with an empty string. Doing so causes ForceDirectories to raise an exception.

The FileCtrl unit (Windows only) also contains a ForceDirectories function. However, the FileCtrl version is deprecated, and the SysUtils version preferred, even if the code does not need to be cross-platform.


 
OlegOren   (2006-04-13 10:48) [3]

фенкс


 
kernel ©   (2006-04-13 18:58) [4]

function CreateDirEx(Dir:String):Boolean;
var I,L:Integer;
   CurDir:String;
begin
 IF ExcludeTrailingBackslash(Dir) = "" then exit;
 Dir := IncludeTrailingBackslash(Dir);
 L:=Length(Dir);
 FOR I:=1 TO L do
 begin
   CurDir := CurDir + Dir[I];
   IF Dir[I] = "\" then
   begin
     IF not DirectoryExists(CurDir) then
       IF Not CreateDir(CurDir) then Exit;
   end;
 end;
 Result := True;
end;


:)


 
Fay ©   (2006-04-13 19:01) [5]

2 kernel ©   (13.04.06 18:58) [4]
Странно как-то проверять наличие какой-либо директории в только что созданной.


 
kernel ©   (2006-04-13 19:06) [6]

Да сам где-то "слизал" этот текст, проверил, вроде бы работает...



Страницы: 1 вся ветка

Текущий архив: 2006.04.30;
Скачать: CL | DM;

Наверх




Память: 0.45 MB
Время: 0.008 c
2-1144937250
ViktorZ
2006-04-13 18:07
2006.04.30
Почему не складывает как люди!!!


15-1143822489
Volf_555
2006-03-31 20:28
2006.04.30
Проблема открытия локального сайта с подключенным интернетом


2-1145031912
fast2
2006-04-14 20:25
2006.04.30
Как, закрыть форму, нажав на Esc?


1-1143093740
Дмитрий_А
2006-03-23 09:02
2006.04.30
Использование Microsoft ScriptControl


15-1144533375
Yanis
2006-04-09 01:56
2006.04.30
Подскажите программу





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский