Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Read Me About CFFTPSample.txt
Read Me About CFFTPSample |
========================= |
1.2 |
CFFTPSample shows how to use the CFFTPStream API to download and upload files using FTP, as well as how to parse FTP directory listings. |
CFFTPStream was first introduced in Mac OS X 10.3, so the code in this sample requires Mac OS X 10.3 or later. However, to simplify the universal binary build process, the current project was built with Xcode 2.4 and GCC 4.0, and thus requires Mac OS X 10.3.9 or later on PowerPC, or any version of Mac OS X on Intel. |
Packing List |
------------ |
The sample contains the following items: |
o Read Me About CFFTPSample.txt -- This file. |
o CFFTPSample.c -- C source code for the program. |
o CFFTPSample.xcodeproj -- An Xcode 2.4 project for the program. |
o build -- A folder containing pre-built binaries. |
Using the Sample |
---------------- |
This sample builds a command-line tool that exercises all the functionality of CFFTPStream. For example: |
$ # Download a file... |
$ ./CFFTPSample -d ftp://ftp.apple.com/developer/MacOSX/CarbonDater.sit.hqx |
$ |
$ # Upload a file... |
$ ./CFFTPSample -u ftp://ftp.apple.com/ "/DockBrowser.sit" |
$ |
$ # List a directory listing... |
$ ./CFFTPSample -l ftp://ftp.apple.com/developer/MacOSX/ |
Building the Sample |
------------------- |
The sample was built using Xcode 2.4 on Mac OS X 10.4.6. You should be able to just open the project and choose Build from the Build menu. This will build the CFFTPSample tool in the "build" directory. |
Credits and Version History |
--------------------------- |
If you find any problems with this sample, mail <dts@apple.com> and I'll try to fix them up. |
1.0 (Aug 2004) was the first shipping version. |
1.1 (Mar 2006) corrected a production problem that dropped the project file and built binary. |
1.2 (Sep 2006) is a significant revision. Fixed a crash when CFFTPCreateParsedResourceListing returned a positive value but a NULL dictionary (r. 4533718). Follow CFNetwork best practice by only reading only one chunk of data per callback (r. 4515194). Terminate FTP upload in recommended fashion (by closing the stream rather than writing zero bytes). General tidy up. |
Share and Enjoy. |
Apple Developer Technical Support |
Networking, Communications, Hardware |
21 Se 2006 |
$Log: Read\040Me\040About\040CFFTPSample.txt,v $ |
Revision 1.1 2006/09/21 14:06:32 eskimo1 |
Converting to plain text. |
Copyright © 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-10-13