#define ASFileSysCreatePathFromCFURLRef ( asfs, cfURLRef )
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;
#define ASFileSysCreatePathFromCString ( asfs, cPath )
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.
|
#define ASFileSysCreatePathFromDIPath ( asfs, cDIPath, aspRelativeTo )
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 |
#define ASFileSysCreatePathFromDIPathText ( asfs, tDIPath, aspRelativeTo )
#define ASFileSysCreatePathFromFSRef ( asfs, fsRef )
#define ASFileSysCreatePathFromFSRefWithCFStringRef ( asfs, fsRefWithCFStringRef )
#define ASFileSysCreatePathFromFSSpec ( asfs, cPath )
#define ASFileSysCreatePathFromPOSIXPath ( asfs, posixPath )
#define ASFileSysCreatePathWithFolderName ( asfs, aspFolder, cFileName )
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. |
#define ASFileSysCreatePathWithFolderNameWithASText ( asfs, aspFolder, tFileName )
#define KAITypeCode ASFourCharCode( 'TEXT' )
#define kAPFTypeCode ASFourCharCode( 'APF ' )
#define kAcrobatCreatorCode ASFourCharCode( 'CARO' )
#define kDictionaryTypeCode ASFourCharCode( 'DICT' )
#define kEDNTypeCode ASFourCharCode( 'fEDN' )
#define kEPSTypeCode ASFourCharCode( 'EPSF' )
#define kETDTypeCode ASFourCharCode( 'fETD' )
#define kExcelCreatorCode ASFourCharCode( 'XCEL' )
#define kFDFTypeCode ASFourCharCode( 'FDF ' )
#define kGIFTypeCode ASFourCharCode( 'GIFf' )
#define kHTMLCreatorCode ASFourCharCode( 'MSIE' )
#define kHTMLTypeCode ASFourCharCode( 'TEXT' )
#define kIllustratorCreatorCode ASFourCharCode( 'ART5' )
#define kImageReadyCreatorCode ASFourCharCode( 'MeSa' )
#define kJPEGTypeCode ASFourCharCode( 'JPEG' )
#define kLocaleTypeCode ASFourCharCode( 'LANG' )
#define kPDFTypeCode ASFourCharCode( 'PDF ' )
#define kPDXTypeCode ASFourCharCode( 'PDX ' )
#define kPICTTypeCode ASFourCharCode( 'PICT' )
#define kPNGTypeCode ASFourCharCode( 'PNGf' )
#define kPSDTypeCode ASFourCharCode( '8BIM' )
#define kPXDFTypeCode ASFourCharCode( 'MARS' )
#define kPhotoshopCreatorCode ASFourCharCode( '8BIM' )
#define kPluginNewTypeCode ASFourCharCode( 'XTNc' )
#define kPluginTypeCode ASFourCharCode( 'XTND' )
#define kPowerPointCreatorCode ASFourCharCode( 'SLD8' )
#define kPrefsTypeCode ASFourCharCode( 'PREF' )
#define kQuickTimeCreatorCode ASFourCharCode( 'TVOD' )
#define kQuickTimeTypeCode ASFourCharCode( 'MooV' )
#define kRMFTypeCode ASFourCharCode( 'RMF ' )
#define kRTFTypeCode ASFourCharCode( 'RTF ' )
#define kSequenceTypeCode ASFourCharCode( 'SEQU' )
#define kTIFFTypeCode ASFourCharCode( 'TIFF' )
#define kTextCreatorCode ASFourCharCode( 'ttxt' )
#define kTextTypeCode ASFourCharCode( 'TEXT' )
#define kUnknownCreatorCode 0x3f3f3f3f
#define kUnknownTypeCode 0x3f3f3f3f
#define kWHATypeCode ASFourCharCode( 'WHA ' )
#define kWordCreatorCode ASFourCharCode( 'W8BN' )
#define kXDPTypeCode ASFourCharCode( 'XDP ' )
#define kXFDFTypeCode ASFourCharCode( 'XFDF' )
#define kXMLTypeCode ASFourCharCode( 'TEXT' )
Value options for ASFileSysItemType.
kASFileSysFile | The object is associated with a file.
|
kASFileSysFolder | The object is associated with a folder.
|
kASFileSysUnknown=-1 | The object type is unknown.
|
typedef ASUns32 ASDiskSpace;
typedef ASUns64 ASDiskSpace64;
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.
|
typedef ASUns16 ASFileMode;
typedef struct _t_ASFileSysRec *ASFileSys;
For value options see ASFileSysFOptions.
typedef ASEnum16 ASFileSysItemType;
false. To discard the ASFolderIterator object, call ASFileSysDestroyFolderIterator(). typedef struct _t_ASFolderIterator *ASFolderIterator;
typedef struct _t_ASIORequestRec *ASIORequest;
typedef struct _t_ASPathNameRec *ASPathName;
typedef ASUns32 ASlFileMode;
typedef OSType ASlFileTypeCreator;
typedef ASlFileMode ASlFileTypeCreator;
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.
ASPathName ASFileSysAcquireFileSysPathProc(ASPathName pathName, ASFileSys newFileSys);
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. |
ASPlatformPath * calls to get the actual platform object. ASInt32 ASFileSysAcquirePlatformPathProc(ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath);
path | The ASPathName in the current file system.
|
platformPathType |
|
platformPath | (Filled by the method) The new platform path object.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. 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.
void ASFileSysAsyncAbortProc(ASMDFile f);
f | IN/OUT The file for which all uncompleted asynchronous read and write requests are aborted.
|
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.
ASErrorCode ASFileSysAsyncReadProc(ASIORequest req);
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. |
0 if the request was successfully queued, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysAsyncWriteProc(ASIORequest req);
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. |
0 if the request was successfully queued, a non-zero platform-dependent error code otherwise. void ASFileSysCalledGetPathNameProc(ASFileSys fileSys, void *userData);
ASFileSysPerformOpOnItemProc. ASInt32 ASFileSysCanPerformOpOnItemProc(ASPathName pathName, const char *op);
pathName | The ASPathName of the file.
|
op | The name of the operation to test.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. ASBool ASFileSysCanSetEofProc(ASMDFile f, ASFilePos pos);
f | The file.
|
pos | The new EOF offset.
|
true if the EOF can be set for the file. void ASFileSysClearOutstandingMReadsProc(ASMDFile f);
f | The file that was being read.
|
ASErrorCode ASFileSysCloseProc(ASMDFile f);
f | IN/OUT The file to close.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
ASPathName ASFileSysCopyPathNameProc(ASPathName pathName);
pathName | IN/OUT The path name to copy.
|
ASErrorCode ASFileSysCreateFolderProc(ASPathName path);
path | The path of the folder to create.
|
0 to denote success, an error code otherwise. CString. Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.
ASPathName ASFileSysCreatePathNameProc(ASAtom pathSpecType, const void *pathSpec, const void *mustBeZero);
pathSpecType | The type of the input PDFileSpec.
|
pathSpec | The file specification from which to create an ASPathName.
|
mustBeZero | Reserved for future use.
|
ASErrorCode ASFileSysDIPathFromPathExProc(ASPathName path, ASPathName relativeToThisPath, ASText diPathText);
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.
|
0 if the operation was successful, a non-zero platform-independent error code otherwise. folderIter. void ASFileSysDestroyFolderIteratorProc(ASFolderIterator folderIter);
folderIter | An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().
|
Note: The memory for the char * returned should be freed with the ASfree() method when it is no longer needed.
char *ASFileSysDiPathFromPathProc(ASPathName path, ASPathName relativeToThisPath);
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). |
Places a representation that can be displayed to users of a path into displayText.
This does not raise an error.
ASErrorCode ASFileSysDisplayASTextFromPathProc(ASPathName path, ASText displayText);
char *ASFileSysDisplayStringFromPathProc(ASPathName path);
path | The ASPathName in question.
|
NULL if some error occurred. It must be possible to release its memory with ASfree(). 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.
void ASFileSysDisposePathNameProc(ASPathName pathName);
pathName | The path name to release.
|
ASFolderIterator ASFileSysFirstFolderItemProc(ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath);
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.
|
NULL. ASErrorCode ASFileSysFlushProc(ASMDFile f);
f | IN/OUT The file to flush.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
ASErrorCode ASFileSysFlushVolumeProc(ASPathName pathName);
pathName | The path name for the file whose volume is flushed.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysGetEof64Proc(ASMDFile f, ASFilePos64 *pos);
f | IN/OUT The file whose logical size is obtained.
|
pos | IN/OUT (Filled by the callback) The file's logical size in bytes.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysGetEofProc(ASMDFile f, ASFilePos *pos);
f | IN/OUT The file whose logical size is obtained.
|
pos | IN/OUT (Filled by the callback) The file's logical size in bytes.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASFlagBits ASFileSysGetFileFlags(ASMDFile f);
f | IN/OUT The file whose flags are obtained.
|
(2 ^ 31)- 1 or (2 ^ 63)- 1. If this entry is not present, a value of (2 ^ 31)- 1 should be assumed. ASErrorCode ASFileSysGetFilePositionLimitProc(ASFilePos64 *pos);
pos | IN/OUT The maximum file position that can be handled.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
ASAtom ASFileSysGetFileSysNameProc(void);
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;
ASInt32 ASFileSysGetItemPropsAsCabProc(ASPathName pathName, ASCab theCab);
pathName | The ASPathName associated with the object.
|
theCab | (Filled by the method) Properties describing the object, in cabinet format.
|
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. ASErrorCode ASFileSysGetItemPropsProc(ASPathName pathName, ASFileSysItemProps props);
pathName | The ASPathName associated with the object.
|
props | (Filled by the callback) A properties structure describing the object.
|
0 to denote success, an error code otherwise. Note: This supersedes ASFileSysGetNameProc() for Acrobat 6.0.
ASErrorCode ASFileSysGetNameAsASTextProc(ASPathName pathName, ASText name);
pathName | The ASPathName for which the file name is returned.
|
name | (Filled by the callback) An ASText object for the file name for
pathName. |
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysGetNameForDisplayProc(ASPathName pathName, ASText nameForDisplay);
pathName | The ASPathName for which the name is returned.
|
nameForDisplay | (Filled by the callback) An ASText object for the name for
pathName. |
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
ASErrorCode ASFileSysGetNameProc(ASPathName pathName, char *name, ASTArraySize maxLength);
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. |
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASPathName ASFileSysGetParentProc(ASPathName path);
path | The ASPathName in question.
|
NULL if path is a root directory. It is the client's responsibility to free the returned ASPathName. 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.
void *ASFileSysGetPlatformThingProc(ASPathName path, ASAtom thing);
ASErrorCode ASFileSysGetPos64Proc(ASMDFile f, ASFilePos64 *pos);
f | IN/OUT The file whose current position is obtained.
|
pos | IN/OUT (Must by filled by the callback) The current position.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysGetPosProc(ASMDFile f, ASFilePos *pos);
f | The file whose current position is obtained.
|
pos | (Must by filled by the callback) The current position.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASFlagBits ASFileSysGetStatusProc(ASMDFile f);
f | IN/OUT The file whose status is obtained.
|
ASDiskSpace64 ASFileSysGetStorageFreeSpace64Proc(ASPathName pathName);
pathName | The ASPathName for a file on the volume whose free space is obtained.
|
ASDiskSpace ASFileSysGetStorageFreeSpaceProc(ASPathName pathName);
pathName | The ASPathName for a file on the volume whose free space is obtained.
|
Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.
ASPathName ASFileSysGetTempPathNameProc(ASPathName pathName);
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. |
void ASFileSysGetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator *type, ASlFileTypeCreator *creator);
path | The path to the file.
|
type | (Filled by the callback) The file type.
|
creator | (Filled by the callback) The file creator.
|
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.
ASErrorCode ASFileSysHardFlushProc(ASMDFile f);
ASFileSysRec that tests whether a file is in use by another process. ASBool ASFileSysIsInUseProc(ASPathName pathName);
pathName | IN The ASPathName of the file to be tested.
|
0 if the file is not in use, a non-zero value if the file is in use. ASBool ASFileSysIsSameFileProc(ASMDFile f, ASPathName pathName, ASPathName newPathName);
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.
|
0 if the files are different, a non-zero value if they are the same. 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.
ASErrorCode ASFileSysMReadRequestProc(ASMDFile f, ASFile aFile, ASTFilePos *blockPairs, ASTArraySize nBlockPairs);
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. |
0 if the request was successfully queued, a non-zero platform-dependent error code otherwise. itemPath and props are optional and can be NULL if the caller is not interested in that information. ASBool ASFileSysNextFolderItemProc(ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath);
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.
|
ASErrorCode ASFileSysOpen64Proc(ASPathName pathName, ASFileMode mode, ASMDFile *fP);
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.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysOpenProc(ASPathName pathName, ASFileMode mode, ASMDFile *fP);
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.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.
ASPathName ASFileSysPathFromDIPathExProc(ASConstText diPathText, ASPathName relativeToThisPath);
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. |
Note: The ASPathName returned should be released by the ASFileSysReleasePath() method when it is no longer needed.
ASPathName ASFileSysPathFromDIPathProc(const char *diPath, ASPathName relativeToThisPath);
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. |
ASInt32 ASFileSysPerformOpOnItemProc(ASPathName pathName, const char *op, ASCab params);
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.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. void ASFileSysRangeArrivedProc(ASInt32 start, ASInt32 length, void *clientData);
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.
|
ASSize_t ASFileSysReadProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError);
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.
|
0 if there was an error. void ASFileSysReleasePlatformPathProc(ASPlatformPath platformPath);
platformPath | The ASPathName of the file.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysRemoveFolderProc(ASPathName path);
path | The path of the folder to remove.
|
0 to denote success, an error code otherwise. ASErrorCode ASFileSysRemoveProc(ASPathName pathName);
pathName | IN/OUT The file to delete.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysRenameProc(ASMDFile *f, ASPathName oldPath, ASPathName newPath);
f | The file to rename.
|
oldPath | The file's old path name.
|
newPath | The file's new path name.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
ASMDFile ASFileSysReopenProc(ASMDFile f, ASFileMode newMode, ASErrorCode *error);
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. |
NULL. ASErrorCode ASFileSysSetEof64Proc(ASMDFile f, ASFilePos64 pos);
f | IN/OUT The file to expand or shrink.
|
pos | IN/OUT The desired size in bytes.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysSetEofProc(ASMDFile f, ASFilePos pos);
f | The file to expand or shrink.
|
pos | The desired size in bytes.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASFileSysSetMode() sets and gets parameters for the specified file.
Mode operations:
Operation | Code
|
|---|---|
Get the current mode
| |
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. |
ASlFileMode ASFileSysSetModeProc(ASMDFile f, ASlFileMode modeValue, ASMaskBits modeMask);
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.
|
ASErrorCode ASFileSysSetPos64Proc(ASMDFile f, ASFilePos64 pos);
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.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. ASErrorCode ASFileSysSetPosProc(ASMDFile f, ASFilePos pos);
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).
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. void ASFileSysSetTypeAndCreatorProc(ASPathName path, ASlFileTypeCreator type, ASlFileTypeCreator creator);
path | Path to the file.
|
type | File type.
|
creator | File creator.
|
char *ASFileSysURLFromPathProc(ASPathName path);
path | The ASPathName in question.
|
NULL if it cannot be determined. It must be possible to release the allocated memory with ASfree(). ASSize_t ASFileSysWriteProc(void *ptr, ASSize_t size, ASSize_t count, ASMDFile f, ASErrorCode *pError);
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.
|
0 if there was an error. 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.
ASErrorCode ASFileSysYieldProc(ASMDFile f);
f | IN/OUT The file whose asynchronous I/O requests are yielded.
|
0 if the request was successful, a non-zero platform-dependent error code otherwise. 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.
void ASIODoneProc(ASIORequest req);
req | The I/O request for which data has been read/written.
|
| |
The size of the data structure. It must be set to
sizeof(ASFileSysItemPropsRec). | |
One of the ASFileSysItemType objects.
| |
true if the object's hidden bit is set. | |
true if the object is read-only. | |
true if the file system could determine the creation date of the object. | |
The creation date of the object. It is valid only if
creationDateKnown is true. | |
true if the file system could determine the last modification date of the object. | |
The modification date of the object. It is valid only if
modDateKnown is true. | |
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. | |
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. | |
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. | |
The Mac OS creator code for the file. For other file systems, this will be zero.
| |
The Mac OS type code for the file. For other file systems, this will be zero.
| |
|
| |
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.
| |
Get the amount of free space on the volume.
| |
Flush the volume.
| |
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.
| |
Acquire the path.
| |
Drop read request.
| |
Get the file description.
| |
Begin iterating through the folder.
| |
Get the next folder item.
| |
Destroy the folder iterator.
| |
Set the file mode.
| |
Get the URL from the path.
| |
Get the parent of the input path.
| |
Create a folder.
| |
Remove a folder.
| |
Get a display string representing the path.
| |
Set the type and creator.
| |
Get the type and creator.
| |
Reopen the file.
| |
Perform a hard flush on the file.
| |
Deprecated. Get the platform file system representation.
| |
Get the file item properties in
ASCab format. | |
Test whether an operation can be performed.
| |
Perform the operation.
| |
Acquire the platform path.
| |
Release the platform path.
| |
Get the file name as an
ASText object. | |
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.
| |
Set the current position in a file over 2 GB in length.
| |
Get the current position in a file over 2 GB in length.
| |
Increase or decrease the logical size for a file over 2 GB in length.
| |
Get a file's current logical size for a file over 2 GB in length.
| |
Gets the Windows Explorer or Mac Finder representation of the specified
ASPathName as an ASText object. | |
Get the amount of free space on the volume.
| |
Determine whether the file is in use by another process.
| |
|
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.
| |
void *ptr; | A pointer to data to write to or read from
mdFile. |
An offset (specified in bytes) into
mdFile of the first byte to read or write. | |
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. | |
The number of bytes actually read or written.
| |
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.
|
void *IODoneProcData; | User-supplied data that is available for
IODoneProc to use. |
|
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().
ASPathName ASFileSysAcquireFileSysPath(ASFileSys oldFileSys, ASPathName oldPathName, ASFileSys newFileSys);
oldFileSys | |
oldPathName | IN/OUT The ASPathname in the current file system.
|
newFileSys |
pathName. The following rules apply in the default file systems:pathName may be associated with either a file or a folder.pathName need not exist.
It is the caller's responsibility to release the returned ASPathName.
ASPathName ASFileSysAcquireParent(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | IN/OUT The ASPathName.
|
NULL if the parent could not be returned. 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.
ASInt32 ASFileSysAcquirePlatformPath(ASFileSys fileSys, ASPathName path, ASAtom platformPathType, ASPlatformPath *platformPath);
fileSys | |
path | The ASPathName in the file system specified by fileSys.
|
platformPathType | |
platformPath | (Filled by the method) The new platform path object. Always free this object with ASFileSysReleasePlatformPath() when done.
|
0 if the operation was successful, non-zero error code otherwise. ASInt32 ASFileSysCanPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op);
fileSys | |
pathName | The ASPathName of the file.
|
op | The name of the operation to test. A file system-defined string handled by ASFileSysCanPerformOpOnItemProc().
|
asGenErrNoError if the operation can be performed on the item, or an error indicating why the oepration would fail. ASInt32 ASFileSysConvertCabToItemProps(ASFileSysItemProps props, ASCab theCab);
props | (Filled by the method) The item properties structure.
|
theCab | Properties describing the object, in cabinet format.
|
0 if no error was encountered; otherwise an error code is returned. 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 |
ASInt32 ASFileSysConvertItemPropsToCab(ASCab theCab, const ASFileSysItemPropsRec *props);
theCab | (Filled by the method) Properties describing the object, in cabinet format.
|
props | The item properties structure.
|
0 if no error was encountered; otherwise an error code is returned. 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().
ASPathName ASFileSysCopyPath(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | The ASPathName to copy.
|
pathName. pathName. ASErrorCode ASFileSysCreateFolder(ASFileSys fileSys, ASPathName path, ASBool recurse);
fileSys | |
path | The path of the folder to create.
|
recurse | Recursively create the parent folder if necessary.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. 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).
ASPathName ASFileSysCreatePathName(const ASFileSys fileSys, ASAtom pathSpecType, const void *pathSpec, const void *additionalData);
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:
| ||||||||||||||||||||||||||
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. |
NULL on failure. on Windows if the
pathSpecType is not recognized. | |
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().
char *ASFileSysDIPathFromPath(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath);
fileSys | |
path | The ASPathName to convert.
|
relativeToThisPath |
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.
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().
ASErrorCode ASFileSysDIPathFromPathEx(ASFileSys fileSys, ASPathName path, ASPathName relativeToThisPath, ASText diPathText);
fileSys | |
path | The ASPathName to convert.
|
relativeToThisPath | |
diPathText | (Filled by the method) The ASText object to contain the device-independent path. It must be allocated and freed by the client.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. folderIter. void ASFileSysDestroyFolderIterator(ASFileSys fileSys, ASFolderIterator folderIter);
fileSys | |
folderIter | IN/OUT An ASFolderIterator object returned from a previous call to ASFileSysFirstFolderItem().
|
Returns a user-friendly representation of a path as a text object. It calls ASFileSysDisplayASTextFromPathProc().
This method supersedes ASFileSysDisplayStringFromPath().
ASErrorCode ASFileSysDisplayASTextFromPath(ASFileSys fileSys, ASPathName path, ASText displayText);
fileSys | |
path | The ASPathName in question.
|
displayText | (Filled by method) The text object containing the display representation of the path.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. Note: This method can only be used to get host encoding. For any other encoding, use ASFileSysDisplayASTextFromPath().
char *ASFileSysDisplayStringFromPath(ASFileSys fileSys, ASPathName path);
fileSys | |
path | The ASPathName in question.
|
NULL if this operation is not supported by the file system or some error occurred. Operating system
| Display string
|
|---|---|
Windows
| "C:\\Folder\\File" |
Mac OS
| "Hard Disk:Folder:File" |
UNIX
| "/Folder/File" |
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.
ASFolderIterator ASFileSysFirstFolderItem(ASFileSys fileSys, ASPathName folderPath, ASFileSysItemProps props, ASPathName *itemPath);
fileSys | |
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. |
folderPath contained any files. NULL will be returned if the folder is empty or the operation is not supported by the file system. (raised by the Windows default file system)
| |
asFileErrNotADir
| (raised by the Windows default file system)
|
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.
ASErrorCode ASFileSysFlushVolume(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | IN/OUT The ASPathName from which the volume information is obtained.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. (2 ^ 31)- 1 or (2 ^ 63)- 1. ASFilePos64 ASFileSysGetFilePosLimit(ASFileSys fileSys);
fileSys |
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.
ASErrorCode ASFileSysGetItemProps(ASFileSys fileSys, ASPathName pathName, ASFileSysItemProps props);
fileSys | |
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.
|
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. 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 |
ASInt32 ASFileSysGetItemPropsAsCab(ASFileSys fileSys, ASPathName pathName, ASCab theCab);
fileSys | |
pathName | The ASPathName associated with the object.
|
theCab | (Filled by the method) Properties describing the object, in cabinet format.
|
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. Note: This method can only be used to get host encoding. For any other encoding, use ASFileSysGetNameFromPathAsASText().
ASErrorCode ASFileSysGetNameFromPath(ASFileSys fileSys, ASPathName pathName, char *name, ASTArraySize maxLength);
fileSys | |
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.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. The buffer is returned as a host-encoded C string. ASErrorCode ASFileSysGetNameFromPathAsASText(ASFileSys fileSys, ASPathName pathName, ASText name);
fileSys | |
pathName | The ASPathName associated with the file in question.
|
name | (Filled by the method) The text object containing the file name.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. 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. ASErrorCode ASFileSysGetNameFromPathForDisplay(ASFileSys fileSys, ASPathName pathName, ASText nameForDisplay);
fileSys | |
pathName | The ASPathName associated with the file in question.
|
nameForDisplay | (Filled by the method) The text object containing the name used for display.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. NULL. void *ASFileSysGetPlatformThing(ASFileSys fileSys, ASPathName path, ASAtom thing);
pathName. ASDiskSpace ASFileSysGetStorageFreeSpace(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | IN/OUT The ASPathName in question.
|
0 otherwise. Because the free space is returned as an ASUns32, it is limited to 4 GB. pathName. This is the same as ASFileSysGetStorageFreeSpace() without the 4 GB limit. ASDiskSpace64 ASFileSysGetStorageFreeSpace64(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | IN/OUT The ASPathName.
|
0 otherwise. 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.
ASPathName ASFileSysGetTempPathName(ASFileSys fileSys, ASPathName siblingPathName);
fileSys | |
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. |
NULL otherwise. 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.
void ASFileSysGetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 *type, ASUns32 *creator);
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.
|
ASBool ASFileSysIsLocal(ASFileSys fileSys);
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.
ASBool ASFileSysNextFolderItem(ASFileSys fileSys, ASFolderIterator folderIter, ASFileSysItemProps props, ASPathName *itemPath);
fileSys | |
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. |
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).
ASErrorCode ASFileSysOpenFile(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP);
fileSys | |
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.
|
0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific: Platform
| Error
|
|---|---|
Windows
| |
Mac OS | FSpCreate, FSpSetFInfo, FSpOpenRF, FSpOpenDF, or SetFPos may use). |
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).
ASErrorCode ASFileSysOpenFile64(ASFileSys fileSys, ASPathName pathName, ASFileMode mode, ASFile *fP);
fileSys | |
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.
|
0 if the operation was successful, a non-zero error code otherwise. The error is platform and file-system specific: Platform
| Error
|
|---|---|
Windows
| fileErrGeneral if the developer passed in an invalid ASPathName. |
Mac OS | FSpCreate, FSpSetFInfo, FSpOpenRF, FSpOpenDF, or SetFPos may use).fileErrGeneral if the developer passed in an invalid ASPathName. |
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.
ASPathName ASFileSysPathFromDIPath(ASFileSys fileSys, const char *diPath, ASPathName relativeToThisPath);
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. |
NULL if diPath cannot be converted to an ASPathName or if the specified file does not already exist. 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).
ASPathName ASFileSysPathFromDIPathEx(ASFileSys fileSys, ASConstText diPathText, ASPathName relativeToThisPath);
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. |
NULL if diPath cannot be converted to an ASPathName. This would occur, for example, if the specified file does not already exist. ASInt32 ASFileSysPerformOpOnItem(ASFileSys fileSys, ASPathName pathName, const char *op, ASCab params);
fileSys | |
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.
|
0 if the operation was successful, a nonzero platform-dependent error code otherwise. void ASFileSysReleasePath(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | The ASPathName to release.
|
void ASFileSysReleasePlatformPath(ASFileSys fileSys, ASPlatformPath platformPath);
fileSys | |
platformPath | The platform path object to release.
|
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().
ASErrorCode ASFileSysRemoveFile(ASFileSys fileSys, ASPathName pathName);
fileSys | |
pathName | The file to delete.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. pathName only if it is empty. ASErrorCode ASFileSysRemoveFolder(ASFileSys fileSys, ASPathName path);
fileSys | |
path | The path of the folder to remove.
|
0 if the operation was successful, a non-zero platform-dependent error code otherwise. 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.
void ASFileSysSetTypeAndCreator(ASFileSys fileSys, ASPathName path, ASUns32 type, ASUns32 creator);
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.
|
pathName. It is the caller's responsibility to free the memory associated with the returned string using ASfree(). char *ASFileSysURLFromPath(ASFileSys fileSys, ASPathName path);
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.
|
NULL if some error occurred. The URL is in the standard 'file://' URL style. ASFileSys ASGetDefaultFileSys(void);
ASFileSys ASGetDefaultFileSysForPath(ASAtom pathSpecType, const void *pathSpec);
NULL will be returned. ASFileSys ASGetDefaultUnicodeFileSys(void);
ASFileSys ASGetRamFileSys(void);
ASFileSys ASGetTempFileSys(void);
void ASRamFileSysSetLimitKB(ASInt32 limit);
void ASSetTempFileSys(ASFileSys fileSys);