Packagecom.adobe.flascc.vfs
Interfacepublic interface IVFS
Implementors DefaultVFS

IVFS describes the interface to the flascc virtual filesystem, which controls how the filesystem appears to an flascc application. It is possible for user code to implement this interface, though there is a default implementation, DefaultVFS. The CModule.getVFS method returns the current VFS.



Public Properties
 PropertyDefined By
  console : ISpecialFile
Get the current console for the filesystem.
IVFS
Public Methods
 MethodDefined By
  
addBackingStore(backingStore:IBackingStore, mountPath:String):void
Mounts a backing store as part of the VFS.
IVFS
  
addDirectory(path:String):void
Adds an empty directory to the filesystem.
IVFS
  
addFile(path:String, data:ByteArray):void
Adds a file to the filesystem.
IVFS
  
addSpecialFile(path:String, specialFile:ISpecialFile):void
Add a special file to the filesystem.
IVFS
  
checkPath(path:String):String
Checks a proposed path for a new file.
IVFS
  
closeFile(fileDescriptor:int):void
Closes a file.
IVFS
  
deleteFile(path:String):void
Deletes a file (or directory) from the filesystem.
IVFS
  
getDirectoryEntries(dirpath:String):Vector.<FileHandle>
Retrieves the contents of a directory.
IVFS
  
Looks up the FileHandle instance for a file descriptor.
IVFS
  
Looks up the FileHandle instance for a file descriptor.
IVFS
  
isValidFileDescriptor(fileDescriptor:int):Boolean
Determines whether the argument is a valid file descriptor.
IVFS
  
openFile(fileHandle:FileHandle, fileDescriptor:int = -1):int
Opens a file and assigns it a file descriptor.
IVFS
Property Detail
consoleproperty
console:ISpecialFile

Get the current console for the filesystem. This is the special file "/dev/tty".


Implementation
    public function get console():ISpecialFile
    public function set console(value:ISpecialFile):void
Method Detail
addBackingStore()method
public function addBackingStore(backingStore:IBackingStore, mountPath:String):void

Mounts a backing store as part of the VFS. Once this method returns, files contained within the backing store will be available to the application.

Parameters

backingStore:IBackingStore — The backing store containing the files to add.
 
mountPath:String — The path to the mount point for this backing store. This must be an empty directory.

addDirectory()method 
public function addDirectory(path:String):void

Adds an empty directory to the filesystem. The directory must not already exist.

Parameters

path:String — The absolute path to the directory to be added.

addFile()method 
public function addFile(path:String, data:ByteArray):void

Adds a file to the filesystem. The file must not already exist.

Parameters

path:String — The absolute path to the file to be added.
 
data:ByteArray — The contents of the file.

addSpecialFile()method 
public function addSpecialFile(path:String, specialFile:ISpecialFile):void

Add a special file to the filesystem. Special files are different from regular files in that they don't have any stored contents. Instead calls to read and write for a special file are routed to a callback object. Special files are never persisted across different runs of the application.

Parameters

path:String — The absolute path to the special file.
 
specialFile:ISpecialFile — The callback object for the file.

checkPath()method 
public function checkPath(path:String):String

Checks a proposed path for a new file.

Parameters

path:String — The absolute path to the file.

Returns
String — A value from the CheckPath enum class describing any problems with the proposed file name, if any.
closeFile()method 
public function closeFile(fileDescriptor:int):void

Closes a file. Once this method returns, the file descriptor is no longer valid.

Parameters

fileDescriptor:int — A file descriptor returned from openFile.

deleteFile()method 
public function deleteFile(path:String):void

Deletes a file (or directory) from the filesystem. The file must exist, and if it is a directory, it must be empty.

Parameters

path:String — The absolute path to the file to be deleted.

getDirectoryEntries()method 
public function getDirectoryEntries(dirpath:String):Vector.<FileHandle>

Retrieves the contents of a directory.

Parameters

dirpath:String — The absolute path to the directory.

Returns
Vector.<FileHandle> — An array of FileHandle instances, one per file in the directory, or null if the directory does not exist.
getFileHandleFromFileDescriptor()method 
public function getFileHandleFromFileDescriptor(fileDescriptor:int):FileHandle

Looks up the FileHandle instance for a file descriptor.

Parameters

fileDescriptor:int — A file descriptor.

Returns
FileHandle — The FileHandle corresponding to the file descriptor, or null if the file descriptor is not valid.
getFileHandleFromPath()method 
public function getFileHandleFromPath(path:String):FileHandle

Looks up the FileHandle instance for a file descriptor.

Parameters

path:String — The absolute path to the file to be retrieved.

Returns
FileHandle — The FileHandle corresponding to the path, or null if the path cannot be retrieved.
isValidFileDescriptor()method 
public function isValidFileDescriptor(fileDescriptor:int):Boolean

Determines whether the argument is a valid file descriptor.

Parameters

fileDescriptor:int — A integer that may or may not be a file descriptor.

Returns
Boolean — true if the file descriptor is a valid file descriptor corresponding to an open file, false otherwise.
openFile()method 
public function openFile(fileHandle:FileHandle, fileDescriptor:int = -1):int

Opens a file and assigns it a file descriptor. A file descriptor is a non-negative integer, which remains valid until closeFile is called.

Parameters

fileHandle:FileHandle — An FileHandle instance for the file to be opened.
 
fileDescriptor:int (default = -1) — If specified, the file descriptor to assign. Must not already be a valid file descriptor.

Returns
int — The file descriptor assigned to this file.