Getting Data Transfer Information


Mac OS X header: Carbon/Carbon.h
Mac OS 9 header: URLAccess.h


Getting Data Transfer Information Functions
URLGetError Determines the error code of a failed data transfer operation.
URLGetCurrentState Determines the status of a data transfer operation.
URLGetFileInfo Obtains the file type and creator of a file.
URLIdle Gives the URL Access Manager time to refill its buffers during download operations.


URLGetError

Carbon status: Supported

Determines the error code of a failed data transfer operation.

OSStatus URLGetError (
    URLReference urlRef, 
    OSStatus *urlError
);
Parameter descriptions
urlRef

A reference to the URL whose data transfer operation failed.

urlError

A pointer to a C string representing the name of the error code returned by the failed operation.

function result

A result code.

Discussion

The URLGetError function determines the error code returned when a data transfer operation fails. The error code may be a system error code, a protocol-specific error code, or one of the error codes listed in “URL Access Result Codes”.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


URLGetCurrentState

Carbon status: Supported

Determines the status of a data transfer operation.

OSStatus URLGetCurrentState (
    URLReference urlRef, 
    URLState *state
);
Parameter descriptions
urlRef

A reference to the URL whose data transfer state you want to determine.

state

On return, a pointer to the state of data transfer. See “Data Transfer State Constants” for a description of possible values.

function result

A result code.

Discussion

The URLGetCurrentState function determines the current status of a data transfer operation. You may wish to call URLGetCurrentState periodically to monitor the status of a download or upload operation.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


URLGetFileInfo

Carbon status: Supported

Obtains the file type and creator of a file.

OSStatus URLGetFileInfo (
    StringPtr fName, 
    OSType *fType, 
    OSType *fCreator
);
Parameter descriptions
fName

A pointer to a Pascal string representing the name of the file for which you want information.

fType

On return, a pointer to the file type code of the specified filename.

fCreator

On return, a pointer to the file creator code of the specified filename.

function result

A result code.

Discussion

The URLGetFileInfo function obtains the file type and creator codes for a specified filename. The type and creator codes are determined by the Internet configuration mapping table and are based on the filename extension. For example, if you pass the filename “jane.txt”, URLGetFileInfo will return 'TEXT' in the type parameter and 'ttxt' in the creator parameter.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


URLIdle

Carbon status: Supported

Gives the URL Access Manager time to refill its buffers during download operations.

OSStatus URLIdle ();
function result

A result code.

Discussion

The URLIdle function gives the URL Access Manager time to refill its buffers during download operations. You should call URLIdle periodically after you call the function URLOpen to allow time for the URL Access Manager to refill its buffers.

Availability

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2001 Apple Computer, Inc. (Last Updated July 21, 2001)