fileexists 함수
fileexists 함수
fileexists 는 주어진 경로에 파일이 존재하는지 결정해요.
출처: 문서
본문
fileexists 는 주어진 경로에 파일이 존재하는지 결정해요.
fileexists(path)
함수는 작업(job) 실행 시점이 아니라 구성 파싱 중에 CLI가 평가해요. 따라서 이 함수는 운영자(operator) 호스트의 디스크에 이미 존재하는 파일에만 사용할 수 있어요.
이 함수는 일반 파일(regular files)로만 동작해요. 디렉토리, FIFO, 또는 다른 특수 모드에 사용하면 오류를 반환해요.
Examples
> fileexists("./hello.txt")
true
fileexists("custom-section.sh") ? file("custom-section.sh") : local.default_content
더 알아보기 (Learn more)
file은 주어진 경로에 있는 파일의 내용을 읽어요.