Q&A

  • 현재 디렉토리내의 모든 디렉토리검사
현재 디렉토리에 있는 모든 파일검사는 FIndfirst, findNext로 하는건 알겠는데

현재 디렉토리내에 있는 모든 디렉토리를 검사하려면 어떻게 해야하는지 모르겠습니다.

혹시 아시는분.은 좀 가르쳐주세요..



if FindFirst(CurrentDir+'*.*',faAnyFile, sr) = 0 then 이거대신



var

Attr :integer



if FindFirst(CurrentDir,Attr, sr) = 0 then begin 이걸루 해봤는데도

잘안되는군요.

그럼..



2  COMMENTS
  • Profile
    최용일 2001.11.12 23:57
    안녕하세요. 최용일입니다.



    똑같이 하셔두 되구 검색속성만 바꾸셔두 되는데요...



    if FindFirst(CurrentDir+'*.*',faAnyFile, Sr) = 0 then

    begin

    repeat

    if (SR.Attr and faDirectory) <> 0 then

    if (SR.Name[1] <> '.') then

    ShowMessage(SR.Name);

    until FindNext(SR) <> 0;

    end;

    FindClose(SR);



    -------------------------------------------------



    if FindFirst(CurrentDir+'*.*',faDirectory, Sr) = 0 then

    begin

    repeat

    if (SR.Name[1] <> '.') then

    ShowMessage(SR.Name);

    until FindNext(SR) <> 0;

    end;

    FindClose(SR);



    ^^ 항상 즐코하세요...



    델초보 wrote:

    > 현재 디렉토리에 있는 모든 파일검사는 FIndfirst, findNext로 하는건 알겠는데

    > 현재 디렉토리내에 있는 모든 디렉토리를 검사하려면 어떻게 해야하는지 모르겠습니다.

    > 혹시 아시는분.은 좀 가르쳐주세요..

    >

    > if FindFirst(CurrentDir+'*.*',faAnyFile, sr) = 0 then 이거대신

    >

    > var

    > Attr :integer

    >

    > if FindFirst(CurrentDir,Attr, sr) = 0 then begin 이걸루 해봤는데도

    > 잘안되는군요.

    > 그럼..

    >

  • Profile
    김지태 2001.11.12 23:40
    델초보 wrote:

    > 현재 디렉토리에 있는 모든 파일검사는 FIndfirst, findNext로 하는건 알겠는데

    > 현재 디렉토리내에 있는 모든 디렉토리를 검사하려면 어떻게 해야하는지 모르겠습니다.

    > 혹시 아시는분.은 좀 가르쳐주세요..

    >

    > if FindFirst(CurrentDir+'*.*',faAnyFile, sr) = 0 then 이거대신

    >

    > var

    > Attr :integer

    >

    > if FindFirst(CurrentDir,Attr, sr) = 0 then begin 이걸루 해봤는데도

    > 잘안되는군요.

    > 그럼..

    >





    델초보 wrote:

    > 현재 디렉토리에 있는 모든 파일검사는 FIndfirst, findNext로 하는건 알겠는데

    > 현재 디렉토리내에 있는 모든 디렉토리를 검사하려면 어떻게 해야하는지 모르겠습니다.

    > 혹시 아시는분.은 좀 가르쳐주세요..

    >

    > if FindFirst(CurrentDir+'*.*',faAnyFile, sr) = 0 then 이거대신

    >

    > var

    > Attr :integer

    >

    > if FindFirst(CurrentDir,Attr, sr) = 0 then begin 이걸루 해봤는데도

    > 잘안되는군요.

    > 그럼..

    >



    안냐세영, UserSpace임덩.



    등록을 했는데, 안되서 2번이나 올리네영... 쩝 ㅡㅡ;





    if FindFirst('D:작업실TEMP*.*', faDirectory, sr) = 0 then

    begin

    ShowMessage( sr.Name );

    While FindNext( sr ) = 0 do

    begin

    if sr.Attr = faDirectory then

    ShowMessage( sr.Name );

    end;



    FindClose( sr );

    end

    else

    begin

    ShowMessage( 'Not Found' );

    end



    위와 같이 faDirectory로 했는데 Dir만은 안나오네요.



    그래서 Help를 참조했는데, 위와같이 하면 Dir만 나오네영,



    참 '.', '..'은 현재/상위 Dir로 항상 나오니 필요 없을시에는



    Check를 해두심이... 그럼 20000...