Creates an FTP read stream.
- iOS 2.0–9.0Deprecated
- macOS 10.3–10.11Deprecated
- Mac Catalyst 13.0–13.0Deprecated
- tvOS 9.0–9.0Deprecated
The allocator to use to allocate memory for the new object. Pass
NULL or kCFAllocatorDefault to use the current default allocator.
A pointer to a CFURL structure for the URL to be downloaded that can be created by calling any of the
CFURLCreate functions, such as
A new read stream, or
NULL if the call failed. Ownership follows the The Create Rule.
This function creates an FTP read stream for downloading data from an FTP URL. If the
ftpURL parameter is created with the user name and password as part of the URL (such as
ftp://username:firstname.lastname@example.org) then the user name and password will automatically be set in the
CFReadStream. Otherwise, call
CFReadStreamSetProperty to set the steam’s properties, such as
kCFStreamPropertyFTPPassword to associate a user name and password with the stream that are used to log in when the stream is opened. See Constants for a description of all FTP stream properties.
To initiate a connection with the FTP server, call
CFReadStreamOpen. To read the FTP stream, call
CFReadStreamRead. If the URL refers to a directory, the stream provides the listing results sent by the server. If the URL refers to a file, the stream provides the data in that file.
To close a connection with the FTP server, call
HTTP Final Request property. A value of type CFHTTPMessage containing the final message transmitted by the stream after all modifications (including authentication, connection policy, redirects, and so on) have been made. This property cannot be set.
HTTP Final URL property. A value of type CFURL containing the final HTTP URL. This value differs from the URL in the original HTTP request if an autoredirection occurred. This property cannot be set.
HTTP Should Auto Redirect property. Set this property to
kCFBooleanTrue to enable autoredirection; set this property to
kCFBooleanFalse to disable autoredirection.
FTP File Transfer Offset stream property key for set and copy operations. The value of this property is a CFNumber of type
kCFNumberLongLongType representing the file offset at which to start the transfer.
FTP Password stream property key for set and copy operations. A value of type CFString for storing the login password. Don’t set this property when anonymous FTP is desired.
FTP Proxy stream property key for set and copy operations. The property is a value of type CFDictionary that holds proxy dictionary key-value pairs. The dictionary returned by SystemConfiguration can also be set as the value of this property.
FTP Resource Size read stream property key copy operations. This property stores a CFNumber of type
kCFNumberLongLongType representing the size of a resource in bytes.
FTP Passive Mode stream property key for set and copy operations. Set this property to
kCFBooleanTrue to enable passive mode; set this property to
kCFBooleanFalse to disable passive mode.
FTP User Name stream property key for set and copy operations. A value of type CFString for storing the login user name. Don’t set this property when anonymous FTP is desired.
This function gets error codes in the
kCFStreamErrorDomainSOCKS domain from the
CFStreamError returned by a stream operation.
The type of service for the stream. Providing the service type allows the system to properly handle certain attributes of the stream, including routing and suspension behavior. Most streams do not need to set this property. See Stream Service Types for a list of possible values.
When running CFNetwork code on Windows, this domain returns error codes associated with the underlying TCP/IP stack. You should also note that non-networking errors such as
ENOMEM are delivered through the POSIX domain. See the header
winsock2.h for relevant error codes.
A boolean value indicating whether the stream is connected over a cellular (WWAN) interface. This is a read-only property, and is
false until the connection has been established.
A Boolean value indicating that the connection should not be established over a cellular (WWAN) connection. This value can only be set before you open the stream.
SSL Peer Trust property key for copy operations, which return a
SecTrustRef object containing the result of the SSL handshake.
Security property key whose value is a CFArray of SecCertificateRefs except for the first element in the array, which is a SecIdentityRef.
Security property key whose value indicates whether the connection is to act as a server in the SSL process.
Security property key whose value specifies the stream’s security level.
Security property key whose value overrides the name used for certificate verification.