티스토리 뷰

Delphi

function DirectoryExists(const Directory: string; FollowLink: Boolean = True): Boolean;

C++

extern PACKAGE bool __fastcall DirectoryExists(const System::UnicodeString Directory, bool FollowLink = true);

Properties

Type

Visibility

Source

Unit

Parent

function

public

System.SysUtils.pas

System.SysUtils.hpp

System.SysUtils

System.SysUtils

Description

Determines whether a specified directory exists.

Call DirectoryExists to determine whether the directory specified by the Directory parameter exists.

If the directory exists, the function returns True.

If the directory does not exist, the function returns False.

If a full path name is entered, DirectoryExists searches for the directory along the designated path.

Otherwise, the Directory parameter is interpreted as a relative path name from the current directory.

지정한 디렉터리가 있는지 여부를 확인합니다.

DirectoryExists를 호출하여 Directory 매개 변수로 지정된 디렉터리가 있는지 판별하십시오.

디렉터리가 있으면 함수는 True를 반환합니다.

디렉터리가 존재하지 않으면 함수는 False를 반환합니다.

전체 경로 이름을 입력하면, DirectoryExists는 지정된 경로를 따라 디렉터리를 검색합니다.

그렇지 않으면 Directory 매개 변수는 현재 디렉터리의 상대 경로 이름으로 해석됩니다.

 

Note: If the Directory parameter is a symbolic link and the FollowLink parameter is set to True, the method is performed on the target directory.

If the first condition is True, but the FollowLink parameter is set to False, the method will be performed on the symbolic link.

If the link is broken, the method will always return False.

Note: The Vcl.FileCtrl unit (Windows only) also contains a DirectoryExists function.

However, the Vcl.FileCtrl version is deprecated, and the System.SysUtils version is preferred, even if the code does not need to be cross-platform.

참고: Directory 매개 변수가 symbolic link이고 FollowLink 매개 변수가 True로 설정된 경우, 메서드는 대상 디렉터리에서 수행됩니다.

첫 번째 조건이 참이지만 FollowLink 매개 변수가 False로 설정된 경우 이 메서드는 symbolic link에서 수행됩니다.

링크가 끊어지면 메서드는 항상 False를 반환합니다.

참고: Vcl.FileCtrl 유닛(Windows에만 해당)에는 DirectoryExists 함수도 있습니다.

그러나 코드가 크로스 플랫폼일 필요는 없지만, Vcl.FileCtrl 버전은 더 이상 사용되지 않으며, System.SysUtils 버전이 선호됩니다.

 

Method behavior if the Directory parameter is a directory:

Directory 매개 변수가 디렉터리인 경우의 메서드 동작:

Target Exists

FollowLink

Method result

YES

True

True

YES

False

True

NO

True

False

NO

False

False

 

Method behavior if the Directory parameter is a symbolic link:

Directory 매개 변수가 symbolic link인 경우의 메서드 동작:

Target Exists

FollowLink

Method result

YES

True

True

YES

False

True

NO

True

False

NO

False

True

 

Example

var

  IsExistDirectory: Boolean;

 

begin

  // True

  IsExistDirectory := DirectoryExists('H:\Develop\test\Reference\System.SysUtils.DirectoryExists');

  Writeln(BoolToStr(IsExistDirectory, True));

 

  // False

  IsExistDirectory := DirectoryExists('H:\456fu45u06nf5460f45n06f450u6346hy374');

  Writeln(BoolToStr(IsExistDirectory, True));

 

  Readln;

end.

 

determine 미국식 [dɪ|t3:rmɪn] 

1. 알아내다, 밝히다
2. (
무엇의 방식유형을) 결정하다
3. (
공식적으로) 확정하다

along 미국식 [ə|lɔ:ŋ] 

1. …을 (계속) 따라
2.
…을 따라 (한 줄로)
3. (
기다란) …을 따라가는 길 어디에

designated 미국·영국 [déziɡnèitid] 

지정된; 관선의

interpret 미국식 [ɪn|t3:rprɪt] 

1. (의미를) 설명하다
2. (
특정한 뜻으로) 이해하다
3.
통역하다

relative 미국·영국 [|relətɪv] 

1. (고려판단이) 비교상의, 상대적인
2. (
…과) 관련지은, (…에) 따라서 본
3.
비교적인; 상대적인

deprecated

중요도가 떨어져 더 이상 사용되지 않고 앞으로는 사라지게 될 (컴퓨터 시스템 기능 등)

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/System.SysUtils.DirectoryExists

'프로그래밍 언어 > Delphi' 카테고리의 다른 글

[Reference] System.Ord  (0) 2017.03.10
[Reference] System.SysUtils.Now  (0) 2017.03.09
[Reference] System.Insert  (0) 2017.03.07
[Reference] System.SysUtils.EncodeTime  (0) 2017.03.06
[Reference] System.SysUtils.DateToStr  (0) 2017.03.05
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함