팩토리 » Api

xplusgetfilestate

Description

로컬 파일의 정보를 읽어들이는 API이다.
반환되는 정보는 class 형태로 Remark 참조.

Parameters

Parameters Type Description
strFilePath STRING 파일 경로
bSetGMTTime BOOL [옵션] 파일시간 GMT기준 여부(기본값:false)

Return Value

Type Description
class 파일정보 (classFileState)

Remark

반환되는 파일 정보 class

classFileState = function()
{
	strcreatetime = "";      // 년월일시분초
	strlastmodifytime = "";  // 년월일시분초
	strlastaccesstime = "";  // 년월일시분초
	strfilepath = "";        // 파일명을 포함한 전체 경로
	strfilefolder = "";      // 경로중 파일명을 제외한 순수 경로
	strfilename = "";        // 파일 이름
	strfiletitle = "";       // 확장자를 뗀 파일 제목
	strfileext = "";         // 확장자
	strversion = "";         // 파일 버전정보가 있는 경우
	nfilesize = 0;           // byte
	breadonly = false;       // 읽기 전용
	bhidden = false;         // 숨김 여부
	bsystem = false;         // 시스템파일인가?
	bdirectory = false;      // 디렉토리인가?
}

// 부가적인 기능으로 제공되는 Class API
// 파일정보의 시간정보를 원하는 포맷의 형태로 읽어 드이는 API
String getcreatetime(strFormat)
String getlastmodifytime(strFormat) 
String getlastaccesstime(strFormat)

전용 브라우저 환경에서만 동작합니다.

Example

function btnFileState_on_mouseup(objInst) { var fileState = factory.xplusgetfilestate("C:\\xFrame\\bin\\xFrameViewer.ocx"); if(fileState == null) { return; } var strFormatCreateTime = fileState.getcreatetime("%Y%M-%D %h:%m:%s"); var strFormatModifyTime = fileState.getlastmodifytime("%Y년 %M월 %D일 %h시 %m분 %s초"); var strFormatAccessTime = fileState.getlastaccesstime("%Y/%M/%D %h:%m:%s"); factory.consoleprint("create time : " + fileState.strcreatetime + " , " + strFormatCreateTime); factory.consoleprint("modify time : " + fileState.strlastmodifytime + " , " + strFormatModifyTime); factory.consoleprint("access time : " + fileState.strlastaccesstime + " , " + strFormatAccessTime); factory.consoleprint("file path : " + fileState.strfilepath); factory.consoleprint("file folder : " + fileState.strfilefolder); factory.consoleprint("file name : " + fileState.strfilename); factory.consoleprint("file title : " + fileState.strfiletitle); factory.consoleprint("file ext : " + fileState.strfileext); factory.consoleprint("file version: " + fileState.strversion); factory.consoleprint("file size : " + fileState.nfilesize + " byte"); factory.consoleprint("readonly : " + fileState.breadonly); factory.consoleprint("hidden : " + fileState.bhidden); factory.consoleprint("system : " + fileState.bsystem); factory.consoleprint("directory : " + fileState.bdirectory); } // 결과 // create time : 20130806114710 , 201308-06 11:47:10 // modify time : 20141201180523 , 2014년 12월 01일 18시 05분 23초 // access time : 20130807180220 , 2013/08/07 18:02:20 // file path : C:\xFrame\bin\xFrameViewer.ocx // file name : xFrameViewer.ocx // file title : xFrameViewer // file version: 14.11.28.1 // file size : 14057582 byte // readonly : false // hidden : false // system : false // directory : false

Viewer Ver.

9.1.1.1

Update Date

20221117