Fórum Cria sub pastas no delphi #176034
19/08/2003
0
´createdir(´C:\casa\MinhaPasta´);´
nao funciona quando colocamos subdiretorios, so funciona quando colocamos do o diretorio princial
´createdir(´C:\casa´);´
que sober uma soluçao vou ficar grato
Tuca100
Curtir tópico
+ 0Posts
19/08/2003
Joilson_gouveia
This example uses a label and a button on a form. When the user clicks the button, all the directories along the specified path that don´t exist are created. The results are reported in the caption of the label:
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: string;
begin
Dir := ´C:\APPS\SALES\LOCAL´;
if DirectoryExists(Dir) then
Label1.Caption := Dir + ´ was created´
end;
Gostei + 0
20/08/2003
Keliniciante
function MkSubDir(sPath : string): Boolean;
begin
if(´\´ = sPath[Length(sPath)])then
begin
sPath := Copy(sPath, 1,Length(sPath)-1);
end;
if((Length(sPath) < 3) or FileCtrl.DirectoryExists(sPath))then
begin
Exit; end;
MkDirMulti(SysUtils.ExtractFilePath(sPath));
try
System.MkDir( sPath );
Result := true;
except
Result := False;
end; end;
Gostei + 0
20/08/2003
Keliniciante
Unit
FileCtrl
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: string;
begin
Dir := ´C:\APPS\SALES\LOCAL´;
if not DirectoryExists(Dir) then
ForceDirectories(Dir);
Label1.Caption := Dir + ´ foi criado´;
end;
Gostei + 0
20/08/2003
Bacalhau
Tenta:
Mkdir(´c:\casa´); // pasta principal
CHDir(´Casa´); // colocas-te na pasta criada
MkDir(´OutraPasta´) // já está!!
Abraço do bacalhau
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)