DL Logo

ASFileSys Definitions

ASFileSysCreatePathFromCFURLRef

Header: ASExpT.h:3835

Syntax

#define ASFileSysCreatePathFromCFURLRef ( asfs, cfURLRef )

ASFileSysCreatePathFromCString

Header: ASExpT.h:3811

Description

Helper macro for the ASFileSysCreatePathName() method.

Note: This macro uses a local variable named scratchFourBytes: ( void * scratchFourBytes). PDF Library users need to provide this variable in order to utilize the macro; the variable must be local to the client application, not to the library. Any client can use this macro provided that it has code similar to the following, in the same source file that uses the macro: static void * scratchFourBytes;

Syntax

#define ASFileSysCreatePathFromCString ( asfs, cPath )

Parameters

asfs
(May be NULL) The file system through which the ASPathName is obtained.
cPath
A C string containing the path for which the ASPathName is obtained.

ASFileSysCreatePathFromDIPath

Header: ASExpT.h:3766

Description

A helper macro for the ASFileSysCreatePathName() method.

Syntax

#define ASFileSysCreatePathFromDIPath ( asfs, cDIPath, aspRelativeTo )

Parameters

asfs
(May be NULL) The file system through which the ASPathName is obtained.
cDIPath
A C string containing the device-independent path for which the ASPathName is obtained.
aspRelativeTo
(May be NULL) An ASPathName against which cDIPath will be evaluated if it contains a relative path.

ASFileSysCreatePathFromDIPathText

Header: ASExpT.h:3770

Syntax

#define ASFileSysCreatePathFromDIPathText ( asfs, tDIPath, aspRelativeTo )

ASFileSysCreatePathFromFSRef

Header: ASExpT.h:3828

Syntax

#define ASFileSysCreatePathFromFSRef ( asfs, fsRef )

ASFileSysCreatePathFromFSRefWithCFStringRef

Header: ASExpT.h:3831

Syntax

#define ASFileSysCreatePathFromFSRefWithCFStringRef ( asfs, fsRefWithCFStringRef )

ASFileSysCreatePathFromFSSpec

Header: ASExpT.h:3824

Syntax

#define ASFileSysCreatePathFromFSSpec ( asfs, cPath )

ASFileSysCreatePathFromPOSIXPath

Header: ASExpT.h:3838

Syntax

#define ASFileSysCreatePathFromPOSIXPath ( asfs, posixPath )

ASFileSysCreatePathWithFolderName

Header: ASExpT.h:3786

Description

Helper macro for the ASFileSysCreatePathName() method.

Syntax

#define ASFileSysCreatePathWithFolderName ( asfs, aspFolder, cFileName )

Parameters

asfs
(May be NULL) The file system through which the ASPathName is obtained.
aspFolder
An ASPathName containing the path of the folder.
cFileName
A C string containing the name of the file. The returned ASPathName contains the result of appending cFileName to aspFolder.

ASFileSysCreatePathWithFolderNameWithASText

Header: ASExpT.h:3790

Syntax

#define ASFileSysCreatePathWithFolderNameWithASText ( asfs, aspFolder, tFileName )

KAITypeCode

Header: ASExpT.h:1763

Description

Adobe Illustrator AI file.

Syntax

#define KAITypeCode ASFourCharCode( 'TEXT' )

kAPFTypeCode

Header: ASExpT.h:1686

Description

Acrobat profile format (PPKLite).

Syntax

#define kAPFTypeCode ASFourCharCode( 'APF ' )

kAcrobatCreatorCode

Header: ASExpT.h:1626

Description

Acrobat creator code.

Syntax

#define kAcrobatCreatorCode ASFourCharCode( 'CARO' )

kDictionaryTypeCode

Header: ASExpT.h:1696

Description

Spelling dictionary file.

Syntax

#define kDictionaryTypeCode ASFourCharCode( 'DICT' )

kEDNTypeCode

Header: ASExpT.h:1728

Description

eBook EDN activation file.

Syntax

#define kEDNTypeCode ASFourCharCode( 'fEDN' )

kEPSTypeCode

Header: ASExpT.h:1768

Description

EPS file.

Syntax

#define kEPSTypeCode ASFourCharCode( 'EPSF' )

kETDTypeCode

Header: ASExpT.h:1723

Description

eBook Exchange Transfer Data (ETD) file.

Syntax

#define kETDTypeCode ASFourCharCode( 'fETD' )

kExcelCreatorCode

Header: ASExpT.h:1813

Description

Microsoft Excel.

Syntax

#define kExcelCreatorCode ASFourCharCode( 'XCEL' )

kFDFTypeCode

Header: ASExpT.h:1651

Description

Forms data format.

Syntax

#define kFDFTypeCode ASFourCharCode( 'FDF ' )

kGIFTypeCode

Header: ASExpT.h:1748

Description

GIF file.

Syntax

#define kGIFTypeCode ASFourCharCode( 'GIFf' )

kHTMLCreatorCode

Header: ASExpT.h:1803

Description

Microsoft Internet Explorer.

Syntax

#define kHTMLCreatorCode ASFourCharCode( 'MSIE' )

kHTMLTypeCode

Header: ASExpT.h:1798

Description

HTML file.

Syntax

#define kHTMLTypeCode ASFourCharCode( 'TEXT' )

kIllustratorCreatorCode

Header: ASExpT.h:1641

Description

Adobe Illustrator creator code.

Syntax

#define kIllustratorCreatorCode ASFourCharCode( 'ART5' )

kImageReadyCreatorCode

Header: ASExpT.h:1636

Description

Adobe ImageReady creator code.

Syntax

#define kImageReadyCreatorCode ASFourCharCode( 'MeSa' )

kJPEGTypeCode

Header: ASExpT.h:1753

Description

JPEG file.

Syntax

#define kJPEGTypeCode ASFourCharCode( 'JPEG' )

kLocaleTypeCode

Header: ASExpT.h:1706

Description

Locale file.

Syntax

#define kLocaleTypeCode ASFourCharCode( 'LANG' )

kPDFTypeCode

Header: ASExpT.h:1646

Description

Portable document format (PDF).

Syntax

#define kPDFTypeCode ASFourCharCode( 'PDF ' )

kPDXTypeCode

Header: ASExpT.h:1676

Description

Acrobat catalog index file.

Syntax

#define kPDXTypeCode ASFourCharCode( 'PDX ' )

kPICTTypeCode

Header: ASExpT.h:1738

Description

Mac OS PICT file.

Syntax

#define kPICTTypeCode ASFourCharCode( 'PICT' )

kPNGTypeCode

Header: ASExpT.h:1758

Description

PNG file.

Syntax

#define kPNGTypeCode ASFourCharCode( 'PNGf' )

kPSDTypeCode

Header: ASExpT.h:1733

Description

Adobe Photoshop PSD file.

Syntax

#define kPSDTypeCode ASFourCharCode( '8BIM' )

kPXDFTypeCode

Header: ASExpT.h:1666

Description

XML PDF.

Syntax

#define kPXDFTypeCode ASFourCharCode( 'MARS' )

kPhotoshopCreatorCode

Header: ASExpT.h:1631

Description

Adobe Photoshop creator code.

Syntax

#define kPhotoshopCreatorCode ASFourCharCode( '8BIM' )

kPluginNewTypeCode

Header: ASExpT.h:1718

Description

Preferred Plug-in file. Using this file type allows shipping of a Carbonized plug-in without worrying that it will try to load and show an error when installed.

Syntax

#define kPluginNewTypeCode ASFourCharCode( 'XTNc' )

kPluginTypeCode

Header: ASExpT.h:1711

Description

Plug-in file.

Syntax

#define kPluginTypeCode ASFourCharCode( 'XTND' )

kPowerPointCreatorCode

Header: ASExpT.h:1823

Description

Microsoft PowerPoint.

Syntax

#define kPowerPointCreatorCode ASFourCharCode( 'SLD8' )

kPrefsTypeCode

Header: ASExpT.h:1671

Description

Preferences file.

Syntax

#define kPrefsTypeCode ASFourCharCode( 'PREF' )

kQuickTimeCreatorCode

Header: ASExpT.h:1793

Description

QuickTime player.

Syntax

#define kQuickTimeCreatorCode ASFourCharCode( 'TVOD' )

kQuickTimeTypeCode

Header: ASExpT.h:1788

Description

QuickTime file.

Syntax

#define kQuickTimeTypeCode ASFourCharCode( 'MooV' )

kRMFTypeCode

Header: ASExpT.h:1681

Description

Adobe Web Buy rights management file.

Syntax

#define kRMFTypeCode ASFourCharCode( 'RMF ' )

kRTFTypeCode

Header: ASExpT.h:1778

Description

Text file.

Syntax

#define kRTFTypeCode ASFourCharCode( 'RTF ' )

kSequenceTypeCode

Header: ASExpT.h:1691

Description

Acrobat sequence file.

Syntax

#define kSequenceTypeCode ASFourCharCode( 'SEQU' )

kTIFFTypeCode

Header: ASExpT.h:1743

Description

TIFF file.

Syntax

#define kTIFFTypeCode ASFourCharCode( 'TIFF' )

kTextCreatorCode

Header: ASExpT.h:1783

Description

SimpleText.

Syntax

#define kTextCreatorCode ASFourCharCode( 'ttxt' )

kTextTypeCode

Header: ASExpT.h:1773

Description

Text file.

Syntax

#define kTextTypeCode ASFourCharCode( 'TEXT' )

kUnknownCreatorCode

Header: ASExpT.h:1833

Description

Unknown application.

Syntax

#define kUnknownCreatorCode 0x3f3f3f3f

kUnknownTypeCode

Header: ASExpT.h:1828

Description

Unknown file.

Syntax

#define kUnknownTypeCode 0x3f3f3f3f

kWHATypeCode

Header: ASExpT.h:1701

Description

Web-hosted applications file.

Syntax

#define kWHATypeCode ASFourCharCode( 'WHA ' )

kWordCreatorCode

Header: ASExpT.h:1818

Description

Microsoft Word.

Syntax

#define kWordCreatorCode ASFourCharCode( 'W8BN' )

kXDPTypeCode

Header: ASExpT.h:1661

Description

XML data package.

Syntax

#define kXDPTypeCode ASFourCharCode( 'XDP ' )

kXFDFTypeCode

Header: ASExpT.h:1656

Description

XML forms data format.

Syntax

#define kXFDFTypeCode ASFourCharCode( 'XFDF' )

kXMLTypeCode

Header: ASExpT.h:1808

Description

XML file.

Syntax

#define kXMLTypeCode ASFourCharCode( 'TEXT' )

ASFileSys Enumerations

ASFileSysFOptions

Header: ASExpT.h:2059

Description

An enumerated data type used to categorize an object associated with an ASPathName.

Value options for ASFileSysItemType.

Enum Constants

kASFileSysFile
The object is associated with a file.
kASFileSysFolder
The object is associated with a folder.
kASFileSysUnknown=-1
The object type is unknown.

ASFileSys Typedefs

ASDiskSpace

Header: ASExpT.h:142

Description

Can only contain values up to 4 GB.

Syntax

typedef ASUns32 ASDiskSpace;

Returned From

ASDiskSpace64

Header: ASExpT.h:145

Syntax

typedef ASUns64 ASDiskSpace64;

Returned From

ASFileMode

Header: ASExpT.h:89

Description

File access modes used to specify how a file can be used when it is open. Not all modes can be specified individually: ASFILE_CREATE can be used only in conjunction with ASFILE_READ or ASFILE_WRITE. In addition, it is acceptable to specify ASFILE_READ and ASFILE_WRITE together by OR-ing the two constants. ASFILE_SERIAL and ASFILE_LOCAL (present only in version 3.0 or later) are hints that help the Acrobat viewer optimize access to the file; they must be OR-ed with one or more of the other constants:
Value
Description
Open the file for reading.
Open the file for writing.
Create the file if it does not exist.
A hint indicating that the file will be accessed sequentially.
A hint indicating that a local copy of the file will be needed.

Syntax

typedef ASUns16 ASFileMode;

Returned From

Used By

ASFileSys

Header: ASExpT.h:1840

Description

A data structure containing callbacks that implement a file system.

Syntax

typedef struct _t_ASFileSysRec *ASFileSys;

Returned From

Used By

Used In

ASFileSysItemType

Header: ASExpT.h:2073

Description

An enumerated data type used to categorize an object associated with an ASPathName.

For value options see ASFileSysFOptions.

Syntax

typedef ASEnum16 ASFileSysItemType;

Used In

ASFolderIterator

Header: ASExpT.h:2164

Description

An opaque object used to iterate through the contents of a folder. ASFileSysFirstFolderItem() returns the first item in the folder along with an ASFolderIterator object for iterating through the rest of the items in the folder. Call ASFileSysNextFolderItem() with this object to return the next object in the folder until the method returns false. To discard the ASFolderIterator object, call ASFileSysDestroyFolderIterator().

Syntax

typedef struct _t_ASFolderIterator *ASFolderIterator;

Returned From

Used By

ASIORequest

Header: ASExpT.h:1939

Description

A data structure representing an I/O request.

Syntax

typedef struct _t_ASIORequestRec *ASIORequest;

Used By

ASPathName

Header: ASExpT.h:1852

Syntax

typedef struct _t_ASPathNameRec *ASPathName;

Returned From

Used By

Used In

ASlFileMode

Header: ASExpT.h:148

Syntax

typedef ASUns32 ASlFileMode;

Used By

Used In

ASlFileTypeCreator

Header: ASExpT.h:153

Syntax

typedef OSType ASlFileTypeCreator;

ASlFileTypeCreator

Header: ASExpT.h:156

Syntax

typedef ASlFileMode ASlFileTypeCreator;

Used By

ASFileSys Callback Signatures

ASFileSysAcquireFileSysPathProc

Header: ASExpT.h:2419

Description

A callback for ASFileSysRec that is used for non-local file systems. It returns an ASPathName on the new ASFileSys that refers to an image (which may be cached) of the remote file. Because of the possibility of cache flushing, you must hold a copy of the remote file's ASPathName for the duration of use of the local file.

Note: Do not remove the local file copy, since the default file system does not know about the linkage to the remote file. The removal of this temporary file should be left to the file system.

Note: The ASPathName returned should be released with the ASFileSysReleasePath() method when it is no longer needed.

Syntax

ASPathName ASFileSysAcquireFileSysPathProc(ASPathName pathName, ASFileSys newFileSys);

Parameters

pathName
IN/OUT The ASPathName for which an equivalent in newFileSys is obtained.
newFileSys
IN/OUT The file system in which an equivalent of pathName is obtained.

Returns

The ASPathName (in newFileSys) for the specified file. It returns NULL if one can not be made.

Used In

ASFileSysAcquirePlatformPathProc

Header: ASExpT.h:3077

Description

A callback for ASFileSysRec that acquires a platform-specific file system representation of the specified path, according to the specified type, wrapped in an allocated ASPlatformPath object. Use the ASPlatformPath * calls to get the actual platform object.

Syntax

ASInt32 ASFileSysAcquirePlatformPathProc(ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath);

Parameters

path
The ASPathName in the current file system.
platformPathType
platformPath
(Filled by the method) The new platform path object.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysAsyncAbortProc

Header: ASExpT.h:2311

Description

A callback for ASFileSysRec that aborts all uncompleted asynchronous I/O requests for the specified file. This callback can be called at any time.

This callback calls each outstanding ASIORequest object's ASIODoneProc() to be called with totalBytes = 0 and error =-1.

Syntax

void ASFileSysAsyncAbortProc(ASMDFile f);

Parameters

f
IN/OUT The file for which all uncompleted asynchronous read and write requests are aborted.

Used In

ASFileSysAsyncReadProc

Header: ASExpT.h:2275

Description

A callback for ASFileSysRec that asynchronously reads the specified data, returning immediately after the request has been queued. The ASFileSys must call the ASIODoneProc() (if one was provided) when the specified data has been read.

This callback is similar to the ASFileSysMReadRequestProc(), except that this callback contains a caller-provided ASIODoneProc() and can only be used for a single byte range.

Syntax

ASErrorCode ASFileSysAsyncReadProc(ASIORequest req);

Parameters

req
A data structure specifying the data to read. It contains information about the request including the ASMDFile, the file offset, the buffer for the request, the number of bytes in the request, an ASIODoneProc(), and client data for the ASIODoneProc(). If the ASIODoneProc() in req is non- NULL and there is an error queueing the read request, the ASIODoneProc() must not be called.

Returns

0 if the request was successfully queued, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysAsyncWriteProc

Header: ASExpT.h:2295

Description

A callback for ASFileSysRec that asynchronously writes the specified data, returning immediately after the request has been queued. The ASFileSys must call the ASIODoneProc() (if one was provided) when the specified data has been written.

Syntax

ASErrorCode ASFileSysAsyncWriteProc(ASIORequest req);

Parameters

req
A data structure specifying the data to write. It contains information about the request including the ASMDFile, the file offset, the buffer for the request, the number of bytes in the request, an ASIODoneProc(), and client data for the ASIODoneProc(). If the ASIODoneProc() in req is non- NULL and there is an error queueing the write request, the ASIODoneProc() must not be called.

Returns

0 if the request was successfully queued, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysCalledGetPathNameProc

Header: ASExpT.h:4094

Syntax

void ASFileSysCalledGetPathNameProc(ASFileSys fileSys, void *userData);

ASFileSysCanPerformOpOnItemProc

Header: ASExpT.h:3037

Description

A callback for ASFileSysRec that tests whether a specified operation can be performed on the file, which means that it tests whether a handler is defined for that operation in ASFileSysPerformOpOnItemProc.

Syntax

ASInt32 ASFileSysCanPerformOpOnItemProc(ASPathName pathName, const char *op);

Parameters

pathName
The ASPathName of the file.
op
The name of the operation to test.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysCanSetEofProc

Header: ASExpT.h:3133

Description

A callback for ASFileSysRec that determines whether ASFileSys can set the end of file marker (EOF) to a new offset for the specified file.

Syntax

ASBool ASFileSysCanSetEofProc(ASMDFile f, ASFilePos pos);

Parameters

f
The file.
pos
The new EOF offset.

Returns

true if the EOF can be set for the file.

Used In

ASFileSysClearOutstandingMReadsProc

Header: ASExpT.h:2383

Description

A callback for ASFileSysRec that is used to advise a file system that the previous range of bytes requested to read are not needed, so that it may drop the read requests. The file system can continue pushing the bytes if it cannot stop the reads.

Syntax

void ASFileSysClearOutstandingMReadsProc(ASMDFile f);

Parameters

f
The file that was being read.

Used In

ASFileSysCloseProc

Header: ASExpT.h:2451

Description

A callback for ASFileSysRec. This callback is responsible for closing the specified file. It is called by ASFileClose().

Syntax

ASErrorCode ASFileSysCloseProc(ASMDFile f);

Parameters

f
IN/OUT The file to close.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysCopyPathNameProc

Header: ASExpT.h:2646

Description

A callback for ASFileSysRec that copies a path name (not the underlying file). It is called by ASFileSysCopyPath().

Copying a path name does not result in any file-level operations, and does not depend on the existence of an open file for the path name.

Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

Related Methods

Syntax

ASPathName ASFileSysCopyPathNameProc(ASPathName pathName);

Parameters

pathName
IN/OUT The path name to copy.

Returns

A new copy of the path name.

Used In

ASFileSysCreateFolderProc

Header: ASExpT.h:2892

Description

A callback for ASFileSysRec used to create an empty folder at the specified path.

Syntax

ASErrorCode ASFileSysCreateFolderProc(ASPathName path);

Parameters

path
The path of the folder to create.

Returns

0 to denote success, an error code otherwise.

Used In

ASFileSysCreatePathNameProc

Header: ASExpT.h:2756

Description

A callback for ASFileSysRec that creates an ASPathName based on the input type and PDFileSpec. Each ASFileSys implementation must publish the input types that it accepts. For example, the Mac OS ASFileSys may accept the type FSSpecPtr, and the MS-DOS ASFileSys may only accept types of CString.

Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

Related Methods

Syntax

ASPathName ASFileSysCreatePathNameProc(ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero);

Parameters

pathSpecType
The type of the input PDFileSpec.
pathSpec
The file specification from which to create an ASPathName.
mustBeZero
Reserved for future use.

Returns

The newly created path name.

Used In

ASFileSysDIPathFromPathExProc

Header: ASExpT.h:3154

Description

A callback for ASFileSysRec that converts a path name to a device-independent path name, returned as an ASText object. It is called by ASFileSysDIPathFromPathEx().

Syntax

ASErrorCode ASFileSysDIPathFromPathExProc(ASPathName path, ASPathName relativeToThisPath, ASText diPathText);

Parameters

path
The path name to convert to a device-independent path name.
relativeToThisPath
The path relative to which the device-independent path name is specified. Pass NULL if the device-independent path name is an absolute path name (for example, c:\\dir1\\dir2\\dir3\\myfile.pdf) instead of a relative pathname (for example,../../dir3/myfile.pdf).
diPathText
(Filled by the method) The ASText object to contain the device-independent path. Must be allocated and freed by the client.

Returns

0 if the operation was successful, a non-zero platform-independent error code otherwise.

Used In

ASFileSysDestroyFolderIteratorProc

Header: ASExpT.h:2829

Description

A callback for ASFileSysRec used to release the resources associated with folderIter.

Syntax

void ASFileSysDestroyFolderIteratorProc(ASFolderIterator folderIter);

Parameters

folderIter
An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().

Used In

ASFileSysDiPathFromPathProc

Header: ASExpT.h:2665

Description

A callback for ASFileSysRec that converts a path name to a device- independent path name. It is called by ASFileSysDIPathFromPath().

Note: The memory for the char * returned should be freed with the ASfree() method when it is no longer needed.

Related Methods

Syntax

char *ASFileSysDiPathFromPathProc(ASPathName path, ASPathName relativeToThisPath);

Parameters

path
IN/OUT The pathname to convert to a device-independent path name.
relativeToThisPath
IN/OUT The path relative to which the device-independent path name is specified. Pass NULL if the device-independent path name is an absolute path name (for example, c:\\dir1\\dir2\\...dir3\\myfile.pdf) instead of a relative path name (for example,../../dir3/myfile.pdf).

Returns

The device-independent path name.

Used In

ASFileSysDisplayASTextFromPathProc

Header: ASExpT.h:3111

Description

Places a representation that can be displayed to users of a path into displayText.

This does not raise an error.

Syntax

ASErrorCode ASFileSysDisplayASTextFromPathProc(ASPathName path, ASText displayText);

Used In

ASFileSysDisplayStringFromPathProc

Header: ASExpT.h:2912

Description

A callback for ASFileSysRec used to obtain a representation of a path that can be displayed by the user.

Syntax

char *ASFileSysDisplayStringFromPathProc(ASPathName path);

Parameters

path
The ASPathName in question.

Returns

The display string, or NULL if some error occurred. It must be possible to release its memory with ASfree().

Used In

ASFileSysDisposePathNameProc

Header: ASExpT.h:2697

Description

A callback for ASFileSysRec that is called by ASFileSysReleasePath().

This callback frees any memory occupied by pathname. It does not result in any file-level operations.

Related Methods

Syntax

void ASFileSysDisposePathNameProc(ASPathName pathName);

Parameters

pathName
The path name to release.

Used In

ASFileSysFirstFolderItemProc

Header: ASExpT.h:2791

Description

A callback for ASFileSysRec that begins the process of iterating through the contents of a folder.

Syntax

ASFolderIterator ASFileSysFirstFolderItemProc(ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath);

Parameters

folderPath
The path to the folder through which to iterate.
props
(Filled by the callback) A properties structure describing the object.
itemPath
(Filled by the callback) A newly allocated ASPathName associated with the object (which the client must free). It contains an absolute path.

Returns

An ASFolderIterator object used for iterating through subsequent items. If there are no items in the folder, this callback returns NULL.

Used In

ASFileSysFlushProc

Header: ASExpT.h:2462

Description

A callback for ASFileSysRec that flushes data for the specified file. It is called by ASFileFlush().

Syntax

ASErrorCode ASFileSysFlushProc(ASMDFile f);

Parameters

f
IN/OUT The file to flush.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysFlushVolumeProc

Header: ASExpT.h:2737

Description

A callback for ASFileSysRec that flushes the volume on which the specified file resides. This ensures that any data written to the system for the volume containing pathName is flushed out to the physical volume (equivalent to the Mac OS FlushVol, or to the UNIX sync). Call this after you are finished writing a complete transaction to force a commit.

This callback is not called directly from any client API method, but is used internally by the Acrobat viewer.

Related Methods

Syntax

ASErrorCode ASFileSysFlushVolumeProc(ASPathName pathName);

Parameters

pathName
The path name for the file whose volume is flushed.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetEof64Proc

Header: ASExpT.h:3266

Description

A callback for ASFileSysRec that gets a file's current logical size. It is called by ASFileGetEOF() and is capable of handling file sizes over 2 GB.

Related Methods

ASFileGetEOF ASFileSetEOF

Syntax

ASErrorCode ASFileSysGetEof64Proc(ASMDFile f, ASFilePos64 *pos);

Parameters

f
IN/OUT The file whose logical size is obtained.
pos
IN/OUT (Filled by the callback) The file's logical size in bytes.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetEofProc

Header: ASExpT.h:2518

Description

A callback for ASFileSysRec that gets a file's current logical size. It is called by ASFileGetEOF(), and is not capable of handling file sizes over 2 GB.

Related Methods

ASFileGetEOF ASFileSetEOF

Syntax

ASErrorCode ASFileSysGetEofProc(ASMDFile f, ASFilePos *pos);

Parameters

f
IN/OUT The file whose logical size is obtained.
pos
IN/OUT (Filled by the callback) The file's logical size in bytes.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetFileFlags

Header: ASExpT.h:2251

Description

A callback for ASFileSysRec that gets the flags for the specified file.

Syntax

ASFlagBits ASFileSysGetFileFlags(ASMDFile f);

Parameters

f
IN/OUT The file whose flags are obtained.

Returns

A bit field using ASFile flags.

Used In

ASFileSysGetFilePositionLimitProc

Header: ASExpT.h:3210

Description

A callback for ASFileSysRec that returns the maximum file position that can be processed by this file system. This is not the maximum size file that can be created, but the maximum file position that can be handled by the arithmetic in the file system implementation. This will typically be (2 ^ 31)- 1 or (2 ^ 63)- 1. If this entry is not present, a value of (2 ^ 31)- 1 should be assumed.

Related Methods

Syntax

ASErrorCode ASFileSysGetFilePositionLimitProc(ASFilePos64 *pos);

Parameters

pos
IN/OUT The maximum file position that can be handled.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetFileSysNameProc

Header: ASExpT.h:2708

Description

A callback for ASFileSysRec that gets this file system's name.

This callback is not called directly by any method in the client API, but is used internally by the Acrobat viewer.

Related Methods

Syntax

ASAtom ASFileSysGetFileSysNameProc(void);

Returns

The ASAtom containing the name of this file system.

Used In

ASFileSysGetItemPropsAsCabProc

Header: ASExpT.h:3023

Description

A callback for ASFileSysRec that gets a full description of the file system object associated with pathName, returning the item properties in the ASCab format.

If the ASCab has no keys on entry, every known property is filled in. If it is not empty, only properties corresponding to keys in the ASCab are filled in. Keys that do not map to a property of the object are removed. The ASCab has the following potential entries:

ASBool isThere;

ASInt32 type;

ASBool isHidden;

ASBool isReadOnly;

char * creationDate; // PDF style date

string char * modDate; // PDF style date string

ASUns32 fileSizeHigh;

ASUns32 fileSizeLow;

ASInt32 folderSize;

ASUns32 creatorCode;

ASUns32 typeCode;

ASUns32 versionMajor;

ASUns32 versionMinor;

ASBool isCheckedOut;

ASBool isPublished;

Syntax

ASInt32 ASFileSysGetItemPropsAsCabProc(ASPathName pathName, ASCab theCab);

Parameters

pathName
The ASPathName associated with the object.
theCab
(Filled by the method) Properties describing the object, in cabinet format.

Returns

0 if no error was encountered; otherwise an error code is returned. If an error code is returned, theCab is not filled with valid values. If the path name does not point to an object on the file system, asFileErrFNF is returned and a valid ASCab with isThere is set to false.

Used In

ASFileSysGetItemPropsProc

Header: ASExpT.h:2769

Description

A callback for ASFileSysRec used to retrieve a full description of the file system object associated with the path.

Related Methods

Syntax

ASErrorCode ASFileSysGetItemPropsProc(ASPathName pathName, ASFileSysItemProps props);

Parameters

pathName
The ASPathName associated with the object.
props
(Filled by the callback) A properties structure describing the object.

Returns

0 to denote success, an error code otherwise.

Used In

ASFileSysGetNameAsASTextProc

Header: ASExpT.h:3105

Description

A callback for ASFileSysRec that gets the file name for the specified ASPathName as an ASText object.

Note: This supersedes ASFileSysGetNameProc() for Acrobat 6.0.

Syntax

ASErrorCode ASFileSysGetNameAsASTextProc(ASPathName pathName, ASText name);

Parameters

pathName
The ASPathName for which the file name is returned.
name
(Filled by the callback) An ASText object for the file name for pathName.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetNameForDisplayProc

Header: ASExpT.h:3280

Description

A callback for ASFileSysRec that gets the Windows Explorer/Mac Finder representation for the specified ASPathName as an ASText object. This may be a localized and extension-stripped version of the filename.

Syntax

ASErrorCode ASFileSysGetNameForDisplayProc(ASPathName pathName, ASText nameForDisplay);

Parameters

pathName
The ASPathName for which the name is returned.
nameForDisplay
(Filled by the callback) An ASText object for the name for pathName.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetNameProc

Header: ASExpT.h:2612

Description

A callback for ASFileSysRec that returns a character string containing the file name for the specified ASPathName. The character string contains only the file name; it is not a complete path name.

This callback is not called directly from any plug-in API method. It is used internally by the Acrobat viewer.

Syntax

ASErrorCode ASFileSysGetNameProc(ASPathName pathName, char *name, ASTArraySize maxLength);

Parameters

pathName
IN/OUT The ASPathName for which the file name is returned.
name
IN/OUT (Filled by the callback) A character string containing the file name for pathName.
maxLength
IN/OUT The maximum number of characters that name can hold.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetParentProc

Header: ASExpT.h:2882

Description

A callback for ASFileSysRec used to obtain the parent of the input path.

Syntax

ASPathName ASFileSysGetParentProc(ASPathName path);

Parameters

path
The ASPathName in question.

Returns

The parent path, or NULL if path is a root directory. It is the client's responsibility to free the returned ASPathName.

Used In

ASFileSysGetPlatformThingProc

Header: ASExpT.h:2981

Description

Returns a platform file system representation of the ASPathName passed according to the atom selector. It allocates memory for the returned structure, which the caller must release with ASfree().

This does not raise an error.

Syntax

void *ASFileSysGetPlatformThingProc(ASPathName path, ASAtom thing);

Used In

ASFileSysGetPos64Proc

Header: ASExpT.h:3239

Description

A callback that gets the current position for the specified file. It is called by ASFileGetPos(), and is capable of handling file postions over 2 GB.

Syntax

ASErrorCode ASFileSysGetPos64Proc(ASMDFile f, ASFilePos64 *pos);

Parameters

f
IN/OUT The file whose current position is obtained.
pos
IN/OUT (Must by filled by the callback) The current position.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetPosProc

Header: ASExpT.h:2490

Description

A callback for ASFileSysRec that gets the current position for the specified file. It is called by ASFileGetPos(), and is not capable of handling file positions over 2 GB.

Syntax

ASErrorCode ASFileSysGetPosProc(ASMDFile f, ASFilePos *pos);

Parameters

f
The file whose current position is obtained.
pos
(Must by filled by the callback) The current position.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysGetStatusProc

Header: ASExpT.h:2395

Description

A callback for ASFileSysRec that gets the status of the specified file. This callback is used for asynchronous I/O. For example, it can indicate that an underlying file connection has been closed.

Related Methods

Syntax

ASFlagBits ASFileSysGetStatusProc(ASMDFile f);

Parameters

f
IN/OUT The file whose status is obtained.

Returns

The file's status, which must be one of the ASFileStatusFlags values.

Used In

ASFileSysGetStorageFreeSpace64Proc

Header: ASExpT.h:3291

Description

A callback for ASFileSysRec that gets the amount of free space on the volume containing the specified ASPathName. It is similar to ASFileSysGetStorageFreeSpace(), except that the return value is not limited to 4 GB (with a 64-bit return value).

Syntax

ASDiskSpace64 ASFileSysGetStorageFreeSpace64Proc(ASPathName pathName);

Parameters

pathName
The ASPathName for a file on the volume whose free space is obtained.

Returns

The free space in bytes.

Used In

ASFileSysGetStorageFreeSpaceProc

Header: ASExpT.h:2718

Description

A callback for ASFileSysRec that gets the amount of free space on the volume containing the specified ASPathName.

Syntax

ASDiskSpace ASFileSysGetStorageFreeSpaceProc(ASPathName pathName);

Parameters

pathName
The ASPathName for a file on the volume whose free space is obtained.

Returns

The free space in bytes. Because the free space is returned as an ASInt32 object, it is limited to 4 GB.

Used In

ASFileSysGetTempPathNameProc

Header: ASExpT.h:2629

Description

A callback for ASFileSysRec that returns a unique path name suitable for use in creating temporary files.

Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

Related Methods

Syntax

ASPathName ASFileSysGetTempPathNameProc(ASPathName pathName);

Parameters

pathName
IN/OUT If pathName is non- NULL, the temporary file must be stored such that a renaming of pathName will succeed. For example, the file is stored on the same volume if renaming across different volumes is illegal on the file system.

Returns

The path name for a temporary file.

Used In

ASFileSysGetTypeAndCreatorProc

Header: ASExpT.h:2941

Description

A callback for ASFileSysRec that gets the file type and creator for the file. This callback is currently only implemented on Mac OS. It does not raise an error.

Syntax

void ASFileSysGetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator *type, ASlFileTypeCreator *creator);

Parameters

path
The path to the file.
type
(Filled by the callback) The file type.
creator
(Filled by the callback) The file creator.

Used In

ASFileSysHardFlushProc

Header: ASExpT.h:2972

Description

Does a hard flush on the file. A hard flush makes sure the data is flushed even if the file is remote. This proc should succeed and do nothing if it is not supported.

This does not raise an error.

Syntax

ASErrorCode ASFileSysHardFlushProc(ASMDFile f);

Used In

ASFileSysIsInUseProc

Header: ASExpT.h:3300

Description

A callback for ASFileSysRec that tests whether a file is in use by another process.

Syntax

ASBool ASFileSysIsInUseProc(ASPathName pathName);

Parameters

pathName
IN The ASPathName of the file to be tested.

Returns

0 if the file is not in use, a non-zero value if the file is in use.

Used In

ASFileSysIsSameFileProc

Header: ASExpT.h:2590

Description

A callback for ASFileSysRec that tests whether two files are the same.

Syntax

ASBool ASFileSysIsSameFileProc(ASMDFile f, ASPathName pathName, ASPathName newPathName);

Parameters

f
IN/OUT The ASFile of the first file to compare. In many implementations it may be unnecessary to use this information: pathName and newPathName may provide sufficient information.
pathName
IN/OUT The ASPathName of the first file to compare.
newPathName
IN/OUT The ASPathName of the second file to compare.

Returns

0 if the files are different, a non-zero value if they are the same.

Used In

ASFileSysMReadRequestProc

Header: ASExpT.h:2368

Description

A callback for ASFileSysRec that queues asynchronous requests for one or more byte ranges that the caller (usually the Acrobat viewer or library) will need in the near future. This callback is important for slow file systems, such as the web, to improve overall performance. It allows the file system to begin retrieving bytes before they are actually needed, while the Acrobat software continues processing as much as it can with the data that has already been downloaded.

This callback does not actually read the data, but merely queues the requests, starts the asynchronous code that reads the data, and returns. The asynchronous code that reads the data must use ASFilePushData() to push the data from each byte range to the Acrobat software as soon as the data is ready.

This callback is similar to the ASFileSysAsyncReadProc(), except that this callback contains a caller-provided ASIODoneProc() and can only be used for a single byte range.

Syntax

ASErrorCode ASFileSysMReadRequestProc(ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs);

Parameters

f
The file whose data is read.
aFile
The corresponding ASFile, for use with ASFilePushData().
blockPairs
An array of file offsets and byte lengths.
nBlockPairs
The number of block pairs in blockPairs.

Returns

0 if the request was successfully queued, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysNextFolderItemProc

Header: ASExpT.h:2814

Description

A callback for ASFileSysRec used to continue the iteration process associated with the ASFolderIterator object. Both itemPath and props are optional and can be NULL if the caller is not interested in that information.

Syntax

ASBool ASFileSysNextFolderItemProc(ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath);

Parameters

folderIter
An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItemProc().
props
(Filled by the callback) A properties structure describing the object.
itemPath
(Filled by the callback) A newly allocated ASPathName associated with the object (which the client must free). It contains an absolute path.

Returns

false if no other objects were found, true otherwise.

Used In

ASFileSysOpen64Proc

Header: ASExpT.h:3194

Description

A callback for ASFileSysRec that opens the specified file. It is called by ASFileSysOpen64(). This callback must be used if the file is over 2 GB in length.

Syntax

ASErrorCode ASFileSysOpen64Proc(ASPathName pathName, ASFileMode mode, ASMDFile *fP);

Parameters

pathName
IN/OUT The path name for the file to open.
mode
IN/OUT The mode in which the file is opened. It must be an OR of the ASFile Open Modes.
fP
IN/OUT (Filled by the callback) The newly opened file.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysOpenProc

Header: ASExpT.h:2438

Description

A callback for ASFileSysRec that opens the specified file. It is called by ASFileSysOpenFile() and ASFileReopen(). This callback returns an error if the file is over 2 GB in length.

Syntax

ASErrorCode ASFileSysOpenProc(ASPathName pathName, ASFileMode mode, ASMDFile *fP);

Parameters

pathName
IN/OUT The path name for the file to open.
mode
IN/OUT The mode in which the file is opened, which must be an OR of the ASFile Open Modes.
fP
IN/OUT (Filled by the callback) The newly opened file.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysPathFromDIPathExProc

Header: ASExpT.h:3176

Description

A callback for ASFileSysRec that converts a device-independent path name from an ASText object to an ASPathName. It is called by ASFileSysPathFromDIPathEx().

Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

Syntax

ASPathName ASFileSysPathFromDIPathExProc(ASConstText diPathText, ASPathName relativeToThisPath);

Parameters

diPathText
A device-independent path name to convert to an ASPathName, as an ASText object.
relativeToThisPath
If diPath is an absolute path name, this parameter's value is NULL. If diPath is a relative path name, its value is the path name relative to which it is specified.

Returns

The ASPathName corresponding to the specified device-independent path name.

Used In

ASFileSysPathFromDIPathProc

Header: ASExpT.h:2685

Description

A callback for ASFileSysRec that converts a device-independent path name to an ASPathName. It is called by ASFileSysPathFromDIPath().

Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.

Syntax

ASPathName ASFileSysPathFromDIPathProc(const char *diPath, ASPathName relativeToThisPath);

Parameters

diPath
IN/OUT A device-independent path name to convert to an ASPathName.
relativeToThisPath
IN/OUT If diPath is an absolute path name, the value of this parameter is NULL. If diPath is a relative path name, the parameter is the path name relative to which it is specified.

Returns

The ASPathName corresponding to the specified device-independent path name.

Used In

ASFileSysPerformOpOnItemProc

Header: ASExpT.h:3052

Description

A callback for ASFileSysRec that performs the specified operation on a particular file.

Syntax

ASInt32 ASFileSysPerformOpOnItemProc(ASPathName pathName, const char *op, ASCab params);

Parameters

pathName
The ASPathName of the file.
op
The name of the operation to perform (a file system-defined string).
params
An ASCab object containing parameters to pass to the operation.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysRangeArrivedProc

Header: ASExpT.h:3121

Description

A callback for ASFileSysRec used when a byte range has arrived during a file load operation.

Syntax

void ASFileSysRangeArrivedProc(ASInt32 start, ASInt32 length, void *clientData);

Parameters

start
The offset from the beginning of the file to the start of the byte range.
length
The number of bytes in the byte range.
clientData
A pointer to the data to pass to the callback.

Used In

ASFileSysReadProc

Header: ASExpT.h:2536

Description

A callback for ASFileSysRec that reads data from the specified file. It is called by ASFileRead() and returns an error if the file size is over 2 GB.

Syntax

ASSize_t ASFileSysReadProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError);

Parameters

ptr
IN/OUT (Filled by the callback) The data read from the file.
size
IN/OUT The size of each item to read.
count
IN/OUT The number of items to read.
f
IN/OUT The file from which data is read.
pError
IN/OUT (Filled by the callback) An error code. This value is filled only if an error occurs. In that case, it should contain an error code.

Returns

The number of bytes read, or 0 if there was an error.

Used In

ASFileSysReleasePlatformPathProc

Header: ASExpT.h:3089

Description

A callback for ASFileSysRec that releases the specified platform path object when the client is done with it.

Syntax

void ASFileSysReleasePlatformPathProc(ASPlatformPath platformPath);

Parameters

platformPath
The ASPathName of the file.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysRemoveFolderProc

Header: ASExpT.h:2902

Description

A callback for ASFileSysRec used to delete the folder at the specified path.

Syntax

ASErrorCode ASFileSysRemoveFolderProc(ASPathName path);

Parameters

path
The path of the folder to remove.

Returns

0 to denote success, an error code otherwise.

Used In

ASFileSysRemoveProc

Header: ASExpT.h:2563

Description

A callback for ASFileSysRec that deletes a file. It is called by ASFileSysRemoveFile().

Related Methods

Syntax

ASErrorCode ASFileSysRemoveProc(ASPathName pathName);

Parameters

pathName
IN/OUT The file to delete.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysRenameProc

Header: ASExpT.h:2576

Description

A callback for ASFileSysRec that renames a file. It is not called directly by any method in the client API, but is used internally by the Acrobat viewer.

Related Methods

Syntax

ASErrorCode ASFileSysRenameProc(ASMDFile *f, ASPathName oldPath, ASPathName newPath);

Parameters

f
The file to rename.
oldPath
The file's old path name.
newPath
The file's new path name.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysReopenProc

Header: ASExpT.h:2963

Description

A callback for ASFileSysRec that reopens a file in the specified mode. ASFileReopen() calls this method if it is present. If this method is not present, or if it returns NULL and error is 0, ASFileReopen() does a close followed by an open. If error is non-zero, ASFileReopen() ignores the return value and fails with that error.

On success, the old file should not need to be closed. On failure, the old file should remain unchanged.

Syntax

ASMDFile ASFileSysReopenProc(ASMDFile f, ASFileMode newMode, ASErrorCode *error);

Parameters

f
The file to reopen.
newMode
The mode for the new session.
error
The error code for the operation. 0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific.

Returns

The newly reopened file or NULL.

Used In

ASFileSysSetEof64Proc

Header: ASExpT.h:3252

Description

A callback for ASFileSysRec that increases or decreases the logical size of a file. It is called by ASFileSetEOF() and is capable of handling file sizes over 2 GB.

Related Methods

ASFileGetEOF ASFileSetEOF

Syntax

ASErrorCode ASFileSysSetEof64Proc(ASMDFile f, ASFilePos64 pos);

Parameters

f
IN/OUT The file to expand or shrink.
pos
IN/OUT The desired size in bytes.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysSetEofProc

Header: ASExpT.h:2504

Description

A callback for ASFileSysRec that increases or decreases the logical size of a file. It is called by ASFileSetEOF(). It returns an error if the current file position is over 2 GB.

Syntax

ASErrorCode ASFileSysSetEofProc(ASMDFile f, ASFilePos pos);

Parameters

f
The file to expand or shrink.
pos
The desired size in bytes.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysSetModeProc

Header: ASExpT.h:2871

Description

ASFileSysSetMode() sets and gets parameters for the specified file.

Mode operations:

Operation

Code
Get the current mode
ASFileSetMode(aFile, 0, 0);
Set the mode
Clear the mode

Setting parameters:

Parameter

Effect
If set, then ASFileRead() will not perform a fileSys->yield() if RaiseIfBytesNotReady is true. Otherwise, it may call yield before raising the exception fileErrBytesNotReady.
If set, mread() requests made via ASFileMReadRequest() become NOPs.
If set, ASFileRead() will raise fileErrBytesNotReady when trying to read from a file with a cache for which the requested bytes are not yet present.

Syntax

ASlFileMode ASFileSysSetModeProc(ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask);

Parameters

asFile
The file handle.
modeValue
The value of bits to be set or cleared.
modeMask
A mask indicating which bits are to be set or cleared.

Used In

ASFileSysSetPos64Proc

Header: ASExpT.h:3225

Description

A callback for ASFileSysRec that sets the current position in a file, which is the point from which data will next be read. It is called by ASFileSetPos() and is capable of handling file postions over 2 GB.

Related Methods

ASFileGetPos ASFileSetPos

Syntax

ASErrorCode ASFileSysSetPos64Proc(ASMDFile f, ASFilePos64 pos);

Parameters

f
IN/OUT The file in which the position is set.
pos
IN/OUT The desired new position, specified in bytes from the beginning of the file.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysSetPosProc

Header: ASExpT.h:2476

Description

A callback for ASFileSysRec that sets the current position in a file (the point from which data will next be read). It is called by ASFileSetPos().

Related Methods

ASFileGetPos ASFileSetPos

Syntax

ASErrorCode ASFileSysSetPosProc(ASMDFile f, ASFilePos pos);

Parameters

f
IN/OUT The file in which the position is set.
pos
IN/OUT The desired new position (specified in bytes from the beginning of the file).

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASFileSysSetTypeAndCreatorProc

Header: ASExpT.h:2926

Description

A callback for ASFileSysRec that sets the file type and creator for the file. This callback is currently only implemented on Mac OS. It does not raise an error.

Syntax

void ASFileSysSetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator type, ASlFileTypeCreator creator);

Parameters

path
Path to the file.
type
File type.
creator
File creator.

Used In

ASFileSysURLFromPathProc

Header: ASExpT.h:2839

Description

A callback for ASFileSysRec used to obtain the URL associated with the given ASPathName.

Related Methods

Syntax

char *ASFileSysURLFromPathProc(ASPathName path);

Parameters

path
The ASPathName in question.

Returns

The URL or NULL if it cannot be determined. It must be possible to release the allocated memory with ASfree().

Used In

ASFileSysWriteProc

Header: ASExpT.h:2552

Description

A callback for ASFileSysRec that writes data to the specified file.

Syntax

ASSize_t ASFileSysWriteProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError);

Parameters

ptr
IN/OUT A buffer containing data to write.
size
IN/OUT The size of each item to write.
count
IN/OUT The number of items to write.
f
IN/OUT The file into which data is written.
pError
IN/OUT (Filled by the callback) Error.

Returns

The number of bytes written, or 0 if there was an error.

Used In

ASFileSysYieldProc

Header: ASExpT.h:2332

Description

A callback for ASFileSysRec that yields the asynchronous I/O requests for the specified file. This allows other processes to process events that may be required for a file read to complete. An ASFileSys should implement a yield mechanism to complement asynchronous read and write requests.

On Windows, this could be a normal PeekMessage-based yield.

In UNIX, it could mean using select on a file descriptor.

Syntax

ASErrorCode ASFileSysYieldProc(ASMDFile f);

Parameters

f
IN/OUT The file whose asynchronous I/O requests are yielded.

Returns

0 if the request was successful, a non-zero platform-dependent error code otherwise.

Used In

ASIODoneProc

Header: ASExpT.h:1989

Description

    A callback in ASIORequest used by the asynchronous read/write ASFileSys implementation and provided by the ASFile implementation to the ASFileSys. The ASFileSys must call this method when an asynchronous request is completed:
  • When an I/O request has some or all of its data.
  • If the request is successfully queued but an error prevents it from completing.
  • If the request is aborted by calling ASFileSysAsyncAbortProc(). In this case, totalBytesCompleted = 0 and pError =-1.

If the request fails, this method must still be called, with the error. It is not called, however, if there is an error queueing the read or write request.

Syntax

void ASIODoneProc(ASIORequest req);

Parameters

req
The I/O request for which data has been read/written.

Used In

ASFileSys Structures

_t_ASFileSysItemProps

Header: ASExpT.h:2083

Description

A list of properties for the object referenced by an ASPathName. It is used in ASFileSysGetItemProps() and the folder enumeration routines.

Syntax

struct _t_ASFileSysItemProps {
ASSize_t size;
The size of the data structure. It must be set to sizeof(ASFileSysItemPropsRec).
ASBool isThere;
true if the object exists. If it is false, none of the following fields are valid.
One of the ASFileSysItemType objects.
ASBool isHidden;
true if the object's hidden bit is set.
ASBool isReadOnly;
true if the object is read-only.
ASBool creationDateKnown;
true if the file system could determine the creation date of the object.
ASTimeRec creationDate;
The creation date of the object. It is valid only if creationDateKnown is true.
ASBool modDateKnown;
true if the file system could determine the last modification date of the object.
ASTimeRec modDate;
The modification date of the object. It is valid only if modDateKnown is true.
ASByteCount fileSize;
If the type is kASFileSysFile, this field holds the lower 32 bits of the size of the file (the upper 32 bits are maintained by fileSizeHigh.
ASByteCount fileSizeHigh;
If the type is kASFileSysFile, this field holds the upper 32 bits of the size of the file (the lower 32 bits are maintained by fileSize.
ASTCount folderSize;
If the type is kASFileSysFolder, this field specifies how many items are in the folder. If this value is-1, the file system was unable to easily determine the number of objects. You will need to explicitly enumerate the objects to determine how many are in the folder.
ASUns32 creatorCode;
The Mac OS creator code for the file. For other file systems, this will be zero.
ASUns32 typeCode;
The Mac OS type code for the file. For other file systems, this will be zero.
} ASFileSysItemPropsRec, *ASFileSysItemProps;

Used By

_t_ASFileSysRec

Header: ASExpT.h:3307

Description

A data structure containing callbacks that implement a file system.

Syntax

struct _t_ASFileSysRec {
ASSize_t size;
The size of the data structure. It must be set to sizeof( ASFileSysRec).
Open file callback.
Close file callback.
Flush callback.
Set position callback.
Get position callback.
Set a file's current logical size.
Get a file's current logical size.
Read file callback.
Write file callback.
Remove file callback.
Rename file callback.
Is the same file.
Get the file name.
Get the temporary path name.
Copy the path name.
Get the device-independent path from the path.
Get the path from the device-independent path.
Dispose the path name.
Get the file system name.
ASFileSysGetStorageFreeSpaceProc getStorageFreeSpace;
Get the amount of free space on the volume.
Flush the volume.
ASFileSysGetFileFlags getFileFlags;
Get the file flags.
Asynchronous read.
Asynchronous write.
Asynchronous abort.
Yield callback.
Asynchronous request for a byte range.
Retrieve the status.
Create the path name.
ASFileSysAcquireFileSysPathProc acquireFileSysPath;
Acquire the path.
ASFileSysClearOutstandingMReadsProc clearOutstandingMReads;
Drop read request.
Get the file description.
Begin iterating through the folder.
Get the next folder item.
ASFileSysDestroyFolderIteratorProc destroyFolderIterator;
Destroy the folder iterator.
ASFileSysSetModeProc setFileMode;
Set the file mode.
Get the URL from the path.
Get the parent of the input path.
Create a folder.
Remove a folder.
ASFileSysDisplayStringFromPathProc displayStringFromPath;
Get a display string representing the path.
ASFileSysSetTypeAndCreatorProc setTypeAndCreator;
Set the type and creator.
ASFileSysGetTypeAndCreatorProc getTypeAndCreator;
Get the type and creator.
Reopen the file.
Perform a hard flush on the file.
Deprecated. Get the platform file system representation.
ASFileSysGetItemPropsAsCabProc getItemPropsAsCab;
Get the file item properties in ASCab format.
ASFileSysCanPerformOpOnItemProc canPerformOpOnItem;
Test whether an operation can be performed.
Perform the operation.
ASFileSysAcquirePlatformPathProc acquirePlatformPath;
Acquire the platform path.
ASFileSysReleasePlatformPathProc releasePlatformPath;
Release the platform path.
Get the file name as an ASText object.
ASFileSysDisplayASTextFromPathProc displayASTextFromPath;
Get the path for display.
The byte range has arrived.
Determine whether the ASFileSys can set the end of file marker (EOF) to a new offset for the specified file.
Convert a path to a device-independent path.
Convert a device-independent path to a path.
Get the maximum file position that can be processed by this file system.
ASFileSysOpen64Proc fsRec_open64;
ASFileSysSetPos64Proc fsRec_setpos64;
Set the current position in a file over 2 GB in length.
ASFileSysGetPos64Proc fsRec_getpos64;
Get the current position in a file over 2 GB in length.
ASFileSysSetEof64Proc fsRec_seteof64;
Increase or decrease the logical size for a file over 2 GB in length.
ASFileSysGetEof64Proc fsRec_geteof64;
Get a file's current logical size for a file over 2 GB in length.
ASFileSysGetNameForDisplayProc getNameForDisplay;
Gets the Windows Explorer or Mac Finder representation of the specified ASPathName as an ASText object.
ASFileSysGetStorageFreeSpace64Proc fsRec_getStorageFreeSpace64;
Get the amount of free space on the volume.
Determine whether the file is in use by another process.
} ASFileSysRec;

Used In

_t_ASIORequestRec

Header: ASExpT.h:2004

Description

The first five items in the ASIORequestSingleRec structure exactly match the parameters of an ASFileSys read or write call.

totalBytesRead is filled in before the IODoneProc is called. If totalBytesRead is 0 or if pError is non-zero, the read was either terminated or did not complete.

If IODoneProc is non-zero, it points to a procedure that must be called either when the request has terminated due to an error or other condition, or when all of the bytes have been received for this request.

Syntax

struct _t_ASIORequestRec {
ASMDFile mdFile;
The MDFile corresponding to the ASFile for which this request is intended.
void *ptr;
A pointer to data to write to or read from mdFile.
ASTFilePos offset;
An offset (specified in bytes) into mdFile of the first byte to read or write.
ASTArraySize count;
The number of bytes to read or write. It must be filled in before IODoneProc is called. If is value is 0, the read was either terminated or did not complete.
ASTArraySize totalBytesCompleted;
The number of bytes actually read or written.
ASErrorCode pError;
An error code. This code is filled by the ASFileSys before IODoneProc is called. If its value is non-zero, the read was either terminated or did not complete.
void *clientData;
User-supplied data that the ASFileSys can use for any purpose.
ASIODoneProc IODoneProc;
A user-supplied callback for use by the ASFileSys when the operation has completed. If it is non- NULL, it points to a procedure that must be called either when the request has terminated due to an error or other condition, or when all of the bytes have been received for this request.
void *IODoneProcData;
User-supplied data that is available for IODoneProc to use.
} ASIORequestRec;

Used In

ASFileSys Functions

ASFileSysAcquireFileSysPath

Header: ASProcs.h:1491

Description

Converts an ASPathName from one file system to another. It returns an ASPathName acquired through newFileSys that refers to an image (which may possibly be cached) of the file in oldfileSys. Use this call to get a local file that is an image of a remote file (in a URL file system, for example). This is needed by programs such as the QuickTime Movie Player, because they can only work from local file-system files. The returned ASPathName may be a reference to a cache, so the file should be treated as read-only.

Because of the possibility of cache flushing, you must hold a copy of the remote file's ASPathName for the duration of use of the local file.

Do not remove the local file copy, since the newFileSys system does not know about the linkage to the remote ( oldFileSys) file!

The source file does not have to be open.

This call is handled by oldFileSys if oldFileSys contains the appropriate procedure. Otherwise it is handled by copying the file. The source file is closed at the end of the copy if it was not open prior to the call.

It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath().

Related Methods

Syntax

ASPathName ASFileSysAcquireFileSysPath(ASFileSys oldFileSys, ASPathName oldPathName, ASFileSys newFileSys);

Parameters

oldFileSys
IN/OUT (May be NULL) The file system from which oldPathName was obtained. Pass NULL to use the default file system.
oldPathName
IN/OUT The ASPathname in the current file system.
newFileSys
IN/OUT (May be NULL) The file system to which the oldPathName is converted. Pass NULL to use the default file system.

Returns

The ASPathName in newFileSys or NULL if one cannot be made.

Exceptions

ASFileSysAcquireParent

Header: ASProcs.h:1730

Description

    Returns the parent folder of the file system object associated with pathName. The following rules apply in the default file systems:
  • pathName may be associated with either a file or a folder.
  • The file system object associated with pathName need not exist.

It is the caller's responsibility to release the returned ASPathName.

Related Methods

Syntax

ASPathName ASFileSysAcquireParent(ASFileSys fileSys, ASPathName pathName);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
IN/OUT The ASPathName.

Returns

The ASPathName associated with the parent folder. The method will return NULL if the parent could not be returned.

Exceptions

ASFileSysAcquirePlatformPath

Header: ASProcs.h:2285

Description

Returns a platform-specific file system representation of the specified path, according to the specified type, wrapped in an allocated ASPlatformPath object. It calls ASFileSysAcquirePlatformPathProc().

This method creates an equivalent platform-specific type (such as FSRef on Mac OS) from an ASPathName. Use ASFileSysCreatePathName() for the reverse situation to create an equivalent ASPathName from a platform-specific type.

In previous releases, you could cast an ASPathName to an FSSpec, for example, but that no longer works because of changes to accommodate long, Unicode file names on Mac OS X). When developing for Mac OS, use this call to get an FSSpec from an ASPathName safely on Mac OS X, without casting. However, it is recommended that you transition to using newer types such as FSRef to be compatible with OS X filenames, or change to using all ASFileSys methods.

Syntax

ASInt32 ASFileSysAcquirePlatformPath(ASFileSys fileSys, ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The ASPathName in the file system specified by fileSys.
platformPathType
The platform path type, one of the following ASAtom values:
ASAtom value
Operating system
FSRefWithCFStringRef
Mac OS
FSSpec
Mac OS
CFURLRef
Mac OS
POSIXPath
Mac OS
FSRef ( pathName object must exist)
Mac OS
CString
Windows/UNIX
platformPath
(Filled by the method) The new platform path object. Always free this object with ASFileSysReleasePlatformPath() when done.

Returns

0 if the operation was successful, non-zero error code otherwise.

ASFileSysCanPerformOpOnItem

Header: ASExtraProcs.h:2259

Description

Tests whether a given operation can be performed on a particular file. It calls the canPerformOpOnItem() procedure registered for the ASFileSysRec, which determines whether the operation is one of the file system-defined operation strings for which there is a handler.

Related Methods

Syntax

ASInt32 ASFileSysCanPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName of the file.
op
The name of the operation to test. A file system-defined string handled by ASFileSysCanPerformOpOnItemProc().

Returns

asGenErrNoError if the operation can be performed on the item, or an error indicating why the oepration would fail.

ASFileSysConvertCabToItemProps

Header: ASExtraProcs.h:2200

Description

Converts a set of item properties from the ASCab format to the ASFileSysItemPropsRec format.

Syntax

ASInt32 ASFileSysConvertCabToItemProps(ASFileSysItemProps props, ASCab theCab);

Parameters

props
(Filled by the method) The item properties structure.
theCab
Properties describing the object, in cabinet format.

Returns

0 if no error was encountered; otherwise an error code is returned.

Exceptions

ASFileSysConvertItemPropsToCab

Header: ASExtraProcs.h:2239

Description

Converts a set of item properties from the ASFileSysItemPropsRec format to the ASCab format.

The ASCab has the following potential entries:

Key Name

Type
isThere
type
isHidden
isReadOnly
creationDate
char * (PDF style date string)
modDate
char * (PDF style date string)
fileSizeHigh
fileSizeLow
folderSize
creatorCode
typeCode
versionMajor
versionMinor
isCheckedOut
isPublished

Syntax

ASInt32 ASFileSysConvertItemPropsToCab(ASCab theCab, const ASFileSysItemPropsRec *props);

Parameters

theCab
(Filled by the method) Properties describing the object, in cabinet format.
props
The item properties structure.

Returns

0 if no error was encountered; otherwise an error code is returned.

Exceptions

ASFileSysCopyPath

Header: ASProcs.h:788

Description

Generates and copies the specified ASPathName (but does not copy the file specified by the path name). The ASPathName must have been obtained through the specified file system. This method may be used regardless of whether the file specified by path name is open.

It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath().

Related Methods

Syntax

ASPathName ASFileSysCopyPath(ASFileSys fileSys, ASPathName pathName);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName to copy.

Returns

A copy of pathName.

ASFileSysCreateFolder

Header: ASProcs.h:1894

Description

Creates an empty folder at the specified pathName.

Related Methods

Syntax

ASErrorCode ASFileSysCreateFolder(ASFileSys fileSys, ASPathName path, ASBool recurse);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The path of the folder to create.
recurse
Recursively create the parent folder if necessary.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Exceptions

ASFileSysCreatePathName

Header: ASProcs.h:1438

Description

Creates an ASPathName based on the input type and pathSpec. Each fileSys implementation must publish the input types that it accepts.

It is the caller's responsibility to release the ASPathName when it is no longer needed by using ASFileSysReleasePath().

Developers should consider using the simpler helper macros instead of using the call directly.

Note: This method does not work for relative POSIX paths on Mac OS; only absolute POSIX paths will work.

Note: Two of the parameters below, DIPath and DIPathWithASText, are File Specification Strings. See ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. You can find this document on the web store of the International Standards Organization (ISO).

Syntax

ASPathName ASFileSysCreatePathName(const ASFileSys fileSys, ASAtom pathSpecType, const void *pathSpec, const void *additionalData);

Parameters

fileSys
(May be NULL) The ASFileSys in which you are trying to create an ASPathName. Pass NULL to use the default file system.
pathSpecType
An ASAtom specifying the data type in pathSpec, as follows:
Data type
Description
"Cstring"
Accepted by the default file system on all platforms. pathSpec is a NULL- terminated char *. On Mac OS it must be an absolute path separated by colons, as in "VolumeName:Folder:file.pdf". On Windows the path may be absolute, as in "C:\\folder\\file.pdf" or relative as in "...\\folder\\file.pdf". On UNIX the path may be absolute as in "/folder/file.pdf" or relative as in ".../folder/file.pdf".
"FSSpec"
Accepted by the default file system on Mac OS. pathSpec is a pointer to a valid FSSpec. This type is deprecated in Acrobat 9.0. Use FSRef, FSRefWithCFStringRef, CFURLRef, or POSIXPath instead.
"FSRef"
Accepted by the default file system on Mac OS. pathSpec is a valid FSRef.
"FSRefWithCFStringRef"
Accepted by the default file system on Mac OS. pathSpec is a pointer to a valid FSRefWithCFStringRefRec.
"CFURLRef"
Accepted by the default file system on Mac OS. pathSpec is a valid CFURLRef.
"POSIXPath"
Accepted by the default file system on Mac OS. pathSpec is a NULL-terminated char * containing a POSIX-style, UTF-8 encoded path string.
"SFReply"
In the past this was accepted by the default file system on Mac OS. This type is deprecated and should not be used.
"DIPath"
Accepted by the default file system on Windows and Mac OS. pathSpec is a device-independent path. See "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. pathSpec can contain an absolute or relative path. If a relative path is used, the method will evaluate that path against an ASPathName passed in the mustBeZero parameter.
"DIPathWithASText"
Accepted by the default file system on Windows and Mac OS. pathSpec is a device-independent path, in the form of an ASText. See "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. pathSpec can contain an absolute or relative path. If a relative path is used, the method will evaluate that path against an ASPathName passed in the mustBeZero parameter.
"FolderPathName"
Accepted by the default file system on Windows and Mac OS. pathSpec is an ASPathName that contains the path of a folder. mustBeZero is a C string containing the name of the file. The returned ASPathName contains the result of appending mustBeZero to pathSpec.
"FolderPathNameWithASText"
Accepted by the default file system on Windows and Mac OS. pathSpec is an ASPathName that contains the path of a folder. mustBeZero is an ASText containing the name of the file. The returned ASPathName contains the result of appending mustBeZero to pathSpec.
"WinUnicodePath"
Accepted by the default file system on Windows. If a PDF document has a file name using Unicode characters, such as Mandarin or Korean characters, the file can be opened in Adobe PDF Library using the WinUnicodePath ASAtom.
pathSpec
The file specification from which to create an ASPathName. Relative paths are evaluated from the directory containing the executable (if used with the PDF Library), or the directory containing Acrobat (if used in a plug-in).
additionalData
See pathSpecType parameter description.

Returns

The newly created path name, or NULL on failure.

Exceptions

on Windows if the pathSpecType is not recognized.

ASFileSysDIPathFromPath

Header: ASProcs.h:728

Description

Converts a file name, specified as an ASPathName, to a device-independent path name. It is the caller's responsibility to free the memory associated with the returned string using ASfree().

Note: On Mac OS, if pathName and relativeToThisPath refer to files that are on different volumes, the method returns an absolute path.

Note: This method can only be used to get host encoding. For any other encoding, use ASFileSysDIPathFromPathEx().

Syntax

char *ASFileSysDIPathFromPath(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The ASPathName to convert.
relativeToThisPath
(May be NULL) The path name relative to which the device-independent path name is specified. If NULL, the device-independent path name will be an absolute, not a relative, path name.

Returns

A device-independent path name corresponding to the parameter values supplied, or NULL if the operation is not supported by the file system.

For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management- Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100.

You can find this document on the web store of the International Standards Organization (ISO).

This path name may not be understood on another platform since drive specifiers may be prepended.

ASFileSysDIPathFromPathEx

Header: ASProcs.h:2540

Description

Converts a file name, specified as an ASPathName, to a device-independent path name, which is returned as an ASText object. It calls ASFileSysDIPathFromPathExProc().

This method supersedes ASFileSysDIPathFromPath().

Syntax

ASErrorCode ASFileSysDIPathFromPathEx(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath, ASText diPathText);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The ASPathName to convert.
relativeToThisPath
(May be NULL) The path name relative to which the device-independent path name is specified. If it is NULL, the device-independent path name will be an absolute, not a relative, path name.
diPathText
(Filled by the method) The ASText object to contain the device-independent path. It must be allocated and freed by the client.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysDestroyFolderIterator

Header: ASProcs.h:1698

Description

Releases the resources associated with folderIter.

Syntax

void ASFileSysDestroyFolderIterator(ASFileSys fileSys, ASFolderIterator folderIter);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which the iteration was started. Pass NULL to use the default file system.
folderIter
IN/OUT An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().

ASFileSysDisplayASTextFromPath

Header: ASProcs.h:2449

Description

Returns a user-friendly representation of a path as a text object. It calls ASFileSysDisplayASTextFromPathProc().

This method supersedes ASFileSysDisplayStringFromPath().

Syntax

ASErrorCode ASFileSysDisplayASTextFromPath(ASFileSys fileSys, ASPathName path, ASText displayText);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The ASPathName in question.
displayText
(Filled by method) The text object containing the display representation of the path.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysDisplayStringFromPath

Header: ASProcs.h:1960

Description

Returns a user-friendly representation of a path. It is the caller's responsibility to release the memory associated with the returned string using ASfree().

Note: This method can only be used to get host encoding. For any other encoding, use ASFileSysDisplayASTextFromPath().

Syntax

char *ASFileSysDisplayStringFromPath(ASFileSys fileSys, ASPathName path);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
path
The ASPathName in question.

Returns

A buffer containing the display string, or NULL if this operation is not supported by the file system or some error occurred.

Example

Operating system
Display string
Windows
"C:\\Folder\\File"
Mac OS
"Hard Disk:Folder:File"
UNIX
"/Folder/File"

ASFileSysFirstFolderItem

Header: ASProcs.h:1654

Description

Creates an iterator which can be used to enumerate all objects inside the specified folder, and returns the properties of the first item found in the folder. The iteration can be continued by passing the returned ASFolderIterator to ASFileSysNextFolderItem.

Both itemProps and itemPath are optional, and may be NULL if you are not interested in that information.

The client is obligated to eventually free the resources associated with ASFolderIterator by calling ASFileSysDestroyFolderIterator().

Note: The order in which items are enumerated is implementation-dependent. Of particular importance is the fact that items will probably not be iterated in alphabetic order.

Note: If items are added to or removed from a folder during iteration, the results are implementation-dependent.

Syntax

ASFolderIterator ASFileSysFirstFolderItem(ASFileSys fileSys, ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which folderPath was obtained. Pass NULL to use the default file system.
folderPath
IN/OUT The path associated with the target folder.
props
IN/OUT (Filled by the method, may be NULL) A properties structure describing the first object iterated.
itemPath
(Filled by the method, may be NULL) An ASPathName, allocated by ASFileSysFirstFolderItem(), which is associated with the object. The caller of ASFileSysFirstFolderItem() must free the ASPathName. This parameter contains an absolute path on Windows and UNIX.

Returns

A valid ASFolderIterator object if folderPath contained any files. NULL will be returned if the folder is empty or the operation is not supported by the file system.

Exceptions

(raised by the Windows default file system)
asFileErrNotADir
(raised by the Windows default file system)

ASFileSysFlushVolume

Header: ASProcs.h:1830

Description

Flushes the volume on which the specified file resides. This ensures that any data written to the system for the volume containing pathName is flushed out to the physical volume (equivalent to Mac OS FlushVol or to the UNIX sync).

Only the Mac OS default file system implements the callback associated with this method. This is a no-op on Windows and UNIX.

Syntax

ASErrorCode ASFileSysFlushVolume(ASFileSys fileSys, ASPathName pathName);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
IN/OUT The ASPathName from which the volume information is obtained.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

ASFileSysGetFilePosLimit

Header: ASProcs.h:2700

Description

Returns the maximum file position that can be processed by this file system. This is not the maximum size file that can be created or the amount of room left in the file system, but the maximum file position that can be handled by the arithmetic in the file system implementation. This will typically be (2 ^ 31)- 1 or (2 ^ 63)- 1.

Related Methods

Syntax

ASFilePos64 ASFileSysGetFilePosLimit(ASFileSys fileSys);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which the path name was obtained. Pass NULL to use the default file system.

Returns

The maximum file position that can be processed.

ASFileSysGetItemProps

Header: ASProcs.h:1610

Description

Populates an ASFileSysItemProps record with a full description of the file system object associated with pathName. It calls ASFileSysGetItemPropsProc().

Note: The method clears the memory associated with itemProps, so the caller need not do so. However, the caller must explicitly set the props->size field of the ASFileSysItemProps structure before calling this method.

Syntax

ASErrorCode ASFileSysGetItemProps(ASFileSys fileSys, ASPathName pathName, ASFileSysItemProps props);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName associated with the object.
props
(Filled by the method) A properties structure describing the object. The size field must be set on input.

Returns

0 if no error was encountered; otherwise an error code is returned. If an error code is returned, props will not be filled with valid values. If no file system object is present, an error will not be reported and the props.isThere field will be false.

Exceptions

ASFileSysGetItemPropsAsCab

Header: ASExtraProcs.h:2182

Description

Gets a full description of the file system object associated with pathName, returning the item properties in the ASCab format. Calls ASFileSysGetItemPropsAsCabProc().

If the ASCab has no keys on entry, every property known is filled in. If it is not empty, only properties corresponding to keys in the ASCab are filled in. Keys that do not map to a property of the object are removed.

The ASCab has the following potential entries:

Key Name

Type
isThere
type
isHidden
isReadOnly
creationDate
char * (PDF style date string)
modDate
char * (PDF style date string)
fileSizeHigh
fileSizeLow
folderSize
creatorCode
typeCode
versionMajor
versionMinor
isCheckedOut
isPublished

Syntax

ASInt32 ASFileSysGetItemPropsAsCab(ASFileSys fileSys, ASPathName pathName, ASCab theCab);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName associated with the object.
theCab
(Filled by the method) Properties describing the object, in cabinet format.

Returns

0 if no error was encountered; otherwise an error code is returned. If an error code is returned, theCab is not filled with valid values. If the path name does not point to an object on the file system, returns asFileErrFNF and a valid ASCab with isThere set to false.

Exceptions

ASFileSysGetNameFromPath

Header: ASProcs.h:1767

Description

Extracts the file name (including extension) from the path.

Note: This method can only be used to get host encoding. For any other encoding, use ASFileSysGetNameFromPathAsASText().

Syntax

ASErrorCode ASFileSysGetNameFromPath(ASFileSys fileSys, ASPathName pathName, char *name, ASTArraySize maxLength);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName associated with the file in question.
name
(Filled by the method) A buffer used to store the file name.
maxLength
Maximum number of bytes that buffer can hold.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise. The buffer is returned as a host-encoded C string.

Exceptions

ASFileSysGetNameFromPathAsASText

Header: ASProcs.h:2430

Description

Extracts the file name (including the extension) from the path as an ASText object. This method supersedes ASFileSysGetNameFromPath().

Related Methods

Syntax

ASErrorCode ASFileSysGetNameFromPathAsASText(ASFileSys fileSys, ASPathName pathName, ASText name);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName associated with the file in question.
name
(Filled by the method) The text object containing the file name.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Exceptions

ASFileSysGetNameFromPathForDisplay

Header: ASProcs.h:2788

Description

This method writes into nameForDisplay the representation of that item as it would be shown in Windows Explorer or Mac OS Finder. For example, it will provide the localized string for "My Documents" even though, on disk, "My Documents" is always in English. It will also strip the extension if that is what Windows Explorer or the Mac Finder would do for that file.

Syntax

ASErrorCode ASFileSysGetNameFromPathForDisplay(ASFileSys fileSys, ASPathName pathName, ASText nameForDisplay);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The ASPathName associated with the file in question.
nameForDisplay
(Filled by the method) The text object containing the name used for display.

Returns

0 if the operation was successful, a non-zero platform-dependent error code otherwise.

Exceptions

ASFileSysGetPlatformThing

Header: ASProcs.h:2239

Description

Deprecated API: always returns NULL.

Syntax

void *ASFileSysGetPlatformThing(ASFileSys fileSys, ASPathName path, ASAtom thing);

ASFileSysGetStorageFreeSpace

Header: ASProcs.h:1808

Description

Gets the amount of free space on the volume containing pathName.

Syntax

ASDiskSpace ASFileSysGetStorageFreeSpace(ASFileSys fileSys, ASPathName pathName);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
IN/OUT The ASPathName in question.

Returns

The amount of free space in bytes, 0 otherwise. Because the free space is returned as an ASUns32, it is limited to 4 GB.

ASFileSysGetStorageFreeSpace64

Header: ASProcs.h:2878

Description

Gets the amount of free space on the volume containing pathName. This is the same as ASFileSysGetStorageFreeSpace() without the 4 GB limit.

Syntax

ASDiskSpace64 ASFileSysGetStorageFreeSpace64(ASFileSys fileSys, ASPathName pathName);

Parameters

fileSys
IN/OUT (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
IN/OUT The ASPathName.

Returns

The amount of free space in bytes, 0 otherwise.

ASFileSysGetTempPathName

Header: ASProcs.h:1794

Description

Returns a unique path name suitable for use in creating temporary files. It is the caller's responsibility to release the returned object using ASFileSysReleasePath().

If siblingPath is non- NULL, the returned ASPathName is created at the same folder level as this path. Otherwise the standard temporary file location is used.

Related Methods

Syntax

ASPathName ASFileSysGetTempPathName(ASFileSys fileSys, ASPathName siblingPathName);

Parameters

fileSys
(May be NULL) The file system from which siblingPath was obtained. Pass NULL to use the default file system.
siblingPathName
(May be NULL) An ASPathName indicating the desired location of the temporary path name. The returned ASPathName is created at the same folder level as this path.

Returns

The ASPathName if the operation was successful, NULL otherwise.

ASFileSysGetTypeAndCreator

Header: ASProcs.h:2006

Description

Gets the type and creator of the file specified by the path.

See Creators and Acrobat Types.

Note: This is only meaningful for the Mac OS default file system. Windows and UNIX always return 0 for both type and creator.

Syntax

void ASFileSysGetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 *type, ASUns32 *creator);

Parameters

fileSys
The file system containing the file for which the type and creator are needed.
path
The path name of the file.
type
(Filled by method) The type of the file.
creator
(Filled by method) The creator of the file.

ASFileSysIsLocal

Header: ASProcs.h:2864

Description

Returns true if fileSys is NULL, the default file system or the default Unicode file system.

Syntax

ASBool ASFileSysIsLocal(ASFileSys fileSys);

Returns

true if fileSys is NULL or a local file system.

ASFileSysNextFolderItem

Header: ASProcs.h:1683

Description

Continues the iteration process associated with the ASFolderIterator object.

Both itemPath and itemProps are optional, and may be NULL if you are not interested in that information.

Syntax

ASBool ASFileSysNextFolderItem(ASFileSys fileSys, ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath);

Parameters

fileSys
(May be NULL) The file system with which the iteration was started. Pass NULL to use the default file system.
folderIter
An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().
props
(Filled by the method, may be NULL) A properties structure describing the next object in the iteration.
itemPath
(Filled by the method, may be NULL) An ASPathName, allocated by ASFileSysNextFolderItem(), which is associated with the object. The caller of ASFileSysNextFolderItem() must free the ASPathName. This parameter contains an absolute path on Windows and UNIX.

Returns

true if another object was found, false otherwise.

Exceptions

ASFileSysOpenFile

Header: ASProcs.h:848

Description

Attempts to open a file in the specified file system, in the specified read/write/create mode. If the file is already open, the existing file handle is returned. The caller retains ownership of pathName.

This call returns an error if a file over 2 GB in length is opened. ASFileSysOpenFile64() should be used instead of this call wherever possible, and must be used if files over 2 GB in length may be encountered.

In Mac OS, when this method creates a file, the file's creator is set to 'CARO' and its type is set to 'PDF ' (with a space after PDF).

Syntax

ASErrorCode ASFileSysOpenFile(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP);

Parameters

fileSys
(May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
pathName
The path name of the file to open.
mode
An open-mode value as specified for ASFileMode.
fP
(Filled by the method) The ASFile that was opened.

Returns

0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific:
Platform
Error
Windows
  • Returns fileErrWrPerm if trying to open a read-only file with write permissions.
  • Returns ErrSysXtnMgr (use GetLastError()) for platform-specific error conditions that CreateFile() may use.
  • Mac OS

  • Returns fileErrFNF if trying to open a file for reading that does not exist.
  • Returns ErrSysMDSystem for platform-specific errors that FSpCreate, FSpSetFInfo, FSpOpenRF, FSpOpenDF, or SetFPos may use).
  • Exceptions

    ASFileSysOpenFile64

    Header: ASProcs.h:2684

    Description

    Attempts to open a file in the specified file system, in the specified read/write/create mode. If the file is already open, the existing file handle is returned. The caller retains ownership of pathName.

    This call can open files over 2 GB in length and should be used instead of ASFileSysOpenFile() whenever possible.

    On Mac OS, when this method creates a file, the file's creator is set to 'CARO' and its type is set to 'PDF ' (with a space after PDF).

    Syntax

    ASErrorCode ASFileSysOpenFile64(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP);

    Parameters

    fileSys
    IN/OUT (May be NULL) The file system from which the path name was obtained. Pass NULL to use the default file system.
    pathName
    IN/OUT The path name of the file to open.
    mode
    IN/OUT An OR of the ASFile Open Modes.
    fP
    IN/OUT (Filled by the method) The ASFile that was opened.

    Returns

    0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific:
    Platform
    Error
    Windows
  • Returns fileErrWrPerm if trying to open a read-only file with write permissions.
  • Returns ErrSysXtnMgr (use GetLastError()) for platform-specific error conditions that CreateFile() may use.
  • Returns fileErrGeneral if the developer passed in an invalid ASPathName.
  • Mac OS

  • Returns fileErrFNF if trying to open a file for reading that does not exist.
  • Returns ErrSysMDSystem for platform-specific errors that FSpCreate, FSpSetFInfo, FSpOpenRF, FSpOpenDF, or SetFPos may use).
  • Returns fileErrGeneral if the developer passed in an invalid ASPathName.
  • Exceptions

    ASFileSysPathFromDIPath

    Header: ASProcs.h:768

    Description

    Converts a device-independent path name to an ASPathName. This method can only be used for files that already exist (that is, it cannot be used to create a placeholder path name for files that a plug-in intends to create in the future).

    It is the caller's responsibility to release the returned ASPathName.

    For details about DIPath, see "File Specification Strings:"

    You can find this document on the web store of the International Standards Organization (ISO).

    Note: Use ASFileSysPathFromDIPathEx() instead for anything other than host encoding.

    Syntax

    ASPathName ASFileSysPathFromDIPath(ASFileSys fileSys, const char *diPath, ASPathName relativeToThisPath);

    Parameters

    fileSys
    (May be NULL) The file system within which the ASPathName will be created. Pass NULL to use the default file system.
    diPath
    The device-independent path name to convert. For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. This path name may not be understood on another platform since drive specifiers may be prepended. On Windows, you cannot specify a UNC path name. You must have a file mounted on the file server. For example, the following path is valid: /f/dirname/file.pdf where f is \\server\\people. The following does not work: /server/people/dirname/file.pdf.
    relativeToThisPath
    The path name relative to which diPath is interpreted. If it is NULL, diPath is interpreted as an absolute path name, not a relative path name.

    Returns

    An ASPathName corresponding to the parameter values supplied, NULL if diPath cannot be converted to an ASPathName or if the specified file does not already exist.

    Exceptions

    ASFileSysPathFromDIPathEx

    Header: ASProcs.h:2585

    Description

    Converts a device-independent path name in an ASText object to an ASPathName. This method can only be used for files that already exist (that is, it cannot be used to create a placeholder path name for files that a plug-in intends to create in the future).

    It is the caller's responsibility to release the returned ASPathName.

    This method supersedes ASFileSysPathFromDIPath().

    For a description of File Specification Strings, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 100. You can find this document on the web store of the International Standards Organization (ISO).

    Syntax

    ASPathName ASFileSysPathFromDIPathEx(ASFileSys fileSys, ASConstText diPathText, ASPathName relativeToThisPath);

    Parameters

    fileSys
    (May be NULL) The file system within which the ASPathName will be created. Pass NULL to use the default file system.
    diPathText
    The device-independent path name to convert, as an ASText object. For a description of the device-independent path name format, see "File Specification Strings," in ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.11.2, page 100. This path name may not be understood on another platform since drive specifiers may be prepended. On Windows, you cannot specify a UNC path name. You must have a file mounted on the file server. For example, the following path is valid: /f/dirname/file.pdf where f is \\server\\people. The following does not work: /server/people/dirname/file.pdf.
    relativeToThisPath
    A path name relative to which diPath is interpreted. If NULL, diPath is interpreted as an absolute path name, not a relative path name.

    Returns

    An ASPathName corresponding to the parameter values supplied. Returns NULL if diPath cannot be converted to an ASPathName. This would occur, for example, if the specified file does not already exist.

    Exceptions

    ASFileSysPerformOpOnItem

    Header: ASExtraProcs.h:2278

    Description

    Performs a specified operation on a particular file, passing specified parameters. It calls the performOpOnItem() procedure registered for the ASFileSysRec.

    Syntax

    ASInt32 ASFileSysPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op, ASCab params);

    Parameters

    fileSys
    (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
    pathName
    The ASPathName of the file.
    op
    The name of the operation to perform. A file system-defined string handled by ASFileSysPerformOpOnItemProc().
    params
    An ASCab object containing parameters to pass to the operation.

    Returns

    0 if the operation was successful, a nonzero platform-dependent error code otherwise.

    ASFileSysReleasePath

    Header: ASProcs.h:802

    Description

    Decrements the internal reference count for the path name and disposes of the path name (but not the file itself) if the reference count is zero. This does not result in any file-level operations, and is unaffected by whether there is an open file for this path name.

    Syntax

    void ASFileSysReleasePath(ASFileSys fileSys, ASPathName pathName);

    Parameters

    fileSys
    (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
    pathName
    The ASPathName to release.

    ASFileSysReleasePlatformPath

    Header: ASProcs.h:2299

    Description

    Releases the specified platform path object. Each call to ASFileSysAcquirePlatformPath() should have a corresponding call to this method.

    Syntax

    void ASFileSysReleasePlatformPath(ASFileSys fileSys, ASPlatformPath platformPath);

    Parameters

    fileSys
    (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
    platformPath
    The platform path object to release.

    ASFileSysRemoveFile

    Header: ASProcs.h:865

    Description

    Attempts to delete the file referred to by pathName.

    Note: If a file is already open for this pathName, the semantics of ASFileSysRemoveFile() are file system-dependent. Make sure you have closed all ASFile objects for pathName before calling ASFileSysRemoveFile().

    Syntax

    ASErrorCode ASFileSysRemoveFile(ASFileSys fileSys, ASPathName pathName);

    Parameters

    fileSys
    (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
    pathName
    The file to delete.

    Returns

    0 if the operation was successful, a non-zero platform-dependent error code otherwise.

    ASFileSysRemoveFolder

    Header: ASProcs.h:1908

    Description

    Deletes the folder at the specified pathName only if it is empty.

    Related Methods

    Syntax

    ASErrorCode ASFileSysRemoveFolder(ASFileSys fileSys, ASPathName path);

    Parameters

    fileSys
    (May be NULL) The file system from which pathName was obtained. Pass NULL to use the default file system.
    path
    The path of the folder to remove.

    Returns

    0 if the operation was successful, a non-zero platform-dependent error code otherwise.

    Exceptions

    ASFileSysSetTypeAndCreator

    Header: ASProcs.h:1986

    Description

    Sets the type and creator of a file. See Type/Creator Codes.

    Note: As is the case for ASFileSysGetTypeAndCreator(), this method only applies to the Mac OS default file system. Windows and UNIX make this a no-op.

    Syntax

    void ASFileSysSetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 type, ASUns32 creator);

    Parameters

    fileSys
    IN/OUT The file system for which the type and creator are needed.
    path
    IN/OUT The path name of the file.
    type
    IN/OUT The type of the file.
    creator
    IN/OUT The creator of the file.

    Returns

    None.

    ASFileSysURLFromPath

    Header: ASProcs.h:1864

    Description

    Returns the URL corresponding to pathName. It is the caller's responsibility to free the memory associated with the returned string using ASfree().

    Syntax

    char *ASFileSysURLFromPath(ASFileSys fileSys, ASPathName path);

    Parameters

    fileSys
    IN/OUT The file system from which path was obtained. Pass NULL to use the default file system.
    path
    IN/OUT The ASPathName in question.

    Returns

    A buffer containing the URL, or NULL if some error occurred. The URL is in the standard 'file://' URL style.

    ASGetDefaultFileSys

    Header: ASProcs.h:691

    Description

    Gets the default standard file system implementation for a platform.

    Syntax

    ASFileSys ASGetDefaultFileSys(void);

    Returns

    The platform's default file system.

    ASGetDefaultFileSysForPath

    Header: ASProcs.h:2852

    Description

    Gets the best file system implementation that supports the passed in path. If the path requires the Unicode file system then the default Unicode file system is returned, otherwise the default file system is returned.

    Syntax

    ASFileSys ASGetDefaultFileSysForPath(ASAtom pathSpecType, const void *pathSpec);

    Returns

    The platform's default or Unicode file system.

    ASGetDefaultUnicodeFileSys

    Header: ASProcs.h:2800

    Description

    Gets the file system implementation that supports Unicode file path names. If a platform does not have a file system that supports Unicode, then NULL will be returned.

    Related Methods

    Syntax

    ASFileSys ASGetDefaultUnicodeFileSys(void);

    Returns

    The platform's Unicode file system.

    ASGetRamFileSys

    Header: ASProcs.h:2616

    Description

    Gets the in-memory file system implementation for a platform.

    Syntax

    ASFileSys ASGetRamFileSys(void);

    Returns

    The platform's in-memory file system.

    ASGetTempFileSys

    Header: ASProcs.h:2595

    Description

    Gets the temporary file system implementation for a platform.

    Related Methods

    Syntax

    ASFileSys ASGetTempFileSys(void);

    Returns

    The platform's default file system.

    ASRamFileSysSetLimitKB

    Header: ASProcs.h:2767

    Description

    Set the in-memory usage Limit for the Ram FileSys (in KB). 0 means no limit, but performance will depend on available memory on the system.

    Related Methods

    Syntax

    void ASRamFileSysSetLimitKB(ASInt32 limit);

    ASSetTempFileSys

    Header: ASProcs.h:2606

    Description

    Sets the temporary file system implementation for a platform.

    Syntax

    void ASSetTempFileSys(ASFileSys fileSys);

    Returns

    none