[AIR] 파일 다루기 1장

AIR 2007/12/14 11:30 |

AIR에서 제공해주는 FILE관련 Class들

flash.filesystem.File
flash.filesystem.FileMode
flash.filesystem.FileStream;

간략한 설명은 대략 이렇다..

File
A File object represents a path to a file or directory. You use a file object to create a pointer to a file or folder, initiating interaction with the file or folder.

FileMode 
The FileMode class defines string constants used in the fileMode parameter of the open() and openAsync() methods of the FileStream class. The fileMode parameter of these methods determines the capabilities available to the FileStream object once the file is opened, which include writing, reading, appending, and updating.

FileStream
A FileStream object is used to open files for reading and writing. Once you've created a File object that points to a new or existing file, you pass that pointer to the FileStream object so that you can open and then manipulate data within the file.

파일객체의 속성을알아보자..

creationDate : 생성일
creator : 생성자(Mac용)
exists : 존재여부 (true,false)
extension : 확장자
icon : 파일에 정의되어 있는 icon객체정보 (BitmapData 배열로 존재한다)
isDirectory : 디렉토리 존재여부
modificationDate : last modified (최종수정일)
name : 확장자를포함한 파일명
nativePath : 절대경로
parent : 상위 파일객체정보
size : File 객체 size
type : 잘쓰이지 않음 ..확장자 return하는것인데 맥에서는 확장자가 4글자로 return됨
url : 파일객체의 url

파일 객체에 대해 알아 보았다..language가 이젠 다 비슷해보인다..java든 php든..ruby든..

자 이젠 이 file객체를 이용해서 간단한 요리를 해보자
다음 포스팅에선 파일을 읽고 쓰는 Flash Tracer를 만들어 볼까한다.
^^ 기대하시랑~



 


크리에이티브 커먼즈 라이선스
Creative Commons License

Trackback Address :: http://lovedev.tistory.com/trackback/109

댓글을 달아 주세요

  1. ActionDev 2007/12/14 17:21 Address Modify/Delete Reply

    Flash Tracer를 만들어 볼까 했는데..포기..
    AIR가 flashlog.txt를 lock하고 있네요..같은 AIR app에서의 trace는 보이는데 AIR app가아닌 web상의 flash가 내뱉는 log는 update자체가 불가해집니다..