Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / December 2005



Tip: Looking for answers? Try searching our database.

Generic Copy paste routine

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pareshgoel@gmail.com - 16 Dec 2005 16:40 GMT
Is there a generic copyFile API available on mac which can take care of
all kinds of FSRefs(network and local) ?
FsCopyFile routine in MoreFilesX.cpp seems to be converting FSRefs to
FSSpecs first.

The routine should be able to work on both OS 10.3 and OS 10.4.

TIA
Chris Baum - 16 Dec 2005 19:42 GMT
> Is there a generic copyFile API available on mac which can take care of
> all kinds of FSRefs(network and local) ?
[quoted text clipped - 4 lines]
>
> TIA

FSCopyObject

http://developer.apple.com/samplecode/FSCopyObject/FSCopyObject.html

For 10.4+, this was rolled into a Carbon api.

hth
pareshgoel@gmail.com - 16 Dec 2005 20:03 GMT
Would this work on Panther(10.3) also??
Chris Baum - 16 Dec 2005 21:41 GMT
> Would this work on Panther(10.3) also??

Yes, the source code I linked to works all the way back to OS 9.
You'll need to download and include that source code in your project.

10.4 is when this code was wrapped into the Carbon framework.
Ben Artin - 17 Dec 2005 00:29 GMT
> > Would this work on Panther(10.3) also??
>
> Yes, the source code I linked to works all the way back to OS 9.
> You'll need to download and include that source code in your project.
>
> 10.4 is when this code was wrapped into the Carbon framework.

Incidentally, FSCopyObject does not work correctly on 10.4 -- it does not copy
HSF+ Extended Attributes -- so the correct solution here is to call
FSCopyObjectSync from the OS on 10.4 and later, and only use the FSCopyObject
sample code on 10.3.

Ben

Signature

If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>

I changed my name: <http://periodic-kingdom.org/People/NameChange.php>

Chris Baum - 17 Dec 2005 01:37 GMT
> Incidentally, FSCopyObject does not work correctly on 10.4 -- it does not
> copy
> HSF+ Extended Attributes -- so the correct solution here is to call
> FSCopyObjectSync from the OS on 10.4 and later, and only use the FSCopyObject
> sample code on 10.3.

Good to know - thx.
Eric Albert - 17 Dec 2005 07:21 GMT
> > > Would this work on Panther(10.3) also??
> >
[quoted text clipped - 7 lines]
> to call FSCopyObjectSync from the OS on 10.4 and later, and only use
> the FSCopyObject sample code on 10.3.

Have you filed a bug report about that?  It sounds important.

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

Gregory Weston - 17 Dec 2005 09:05 GMT
> > > > Would this work on Panther(10.3) also??
> > >
[quoted text clipped - 11 lines]
>
> -Eric

I believe what Chris was describing is that sample code which has been
obviated by 10.4 doesn't work 100% right under 10.4. Not that the
addition in 10.4 that obviated the sample code was flawed.

Signature

Goal 2005: Convincing James Hetfield to cover the Strawberry Shortcake
"Are You Berry Berry Happy?" song.

Eric Albert - 18 Dec 2005 02:18 GMT
> > > > > Would this work on Panther(10.3) also??
> > > >
[quoted text clipped - 9 lines]
> >
> > Have you filed a bug report about that?  It sounds important.

> I believe what Chris was describing is that sample code which has been
> obviated by 10.4 doesn't work 100% right under 10.4. Not that the
> addition in 10.4 that obviated the sample code was flawed.

That's actually Ben but yeah, you're right.  It'd still be good to file
a bug report to get the sample code updated.

-Eric

Signature

Eric Albert         ejalbert@cs.stanford.edu
http://outofcheese.org/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.