FROM : Laurent Souef
DATE : Wed Oct 23 15:04:00 2002
Hi Chris,
I think I need to check my glasses, and probably go to bed since it's=20
midnight already.
Thanks for the tip.
Laurent.
Le mercredi, 23 oct 2002, =E0 23:48 Europe/Paris, Chris Parker a =E9crit =
:
>
> On Wednesday, October 23, 2002, at 02:30 PM, Laurent Souef wrote:
>
>> Ok guys I've got the final word.
>>
>> It seems that movePath function does not allow you to override=20
>> existing files.
>> I changed my code to :
>>
>> [[NSFileManager defaultManager]=20
>> removeFileAtPath:calendarDatabaseFile handler:nil];
>> [[NSFileManager defaultManager] movePath:calendarFile=20
>> toPath:calendarDatabaseFile handler:nil];
>>
>> And it work. Yeah !!!
>> Special thanks to Nick and James for their support.
>>
>> Enjoy,
>> Laurent.
>>
>> PS / Apple guys if you listen to this talk, maybe you could add a=20
>> word on this limitation in the Cocoa documentation. Thx.
>
> Actually, it's there. ;)
>
> "The file specified in source must exist, while destination must not=20=
> yet exist."
>
> When I start running into problems like this, I usually install a=20
> handler object that implements fileManager:shouldProceedAfterError:=20
> and just dump the error dictionary to see what's in it. One of the=20
> errors you can get out of the errorDict is the fact that a file=20
> already exists at the destination.
>
> A lot of NSFileManager whackiness can be cleared up using a handler=20
> object in this manner.
>
> .chris
>
> --=20
> Chris Parker
> Cocoa Frameworks Engineer
> Apple Computer, Inc.
>
Laurent SOUEF
3 Hameau des Chaumettes
83440 Montauroux
France
Tel : (33) 4 94 39 11 40
DATE : Wed Oct 23 15:04:00 2002
Hi Chris,
I think I need to check my glasses, and probably go to bed since it's=20
midnight already.
Thanks for the tip.
Laurent.
Le mercredi, 23 oct 2002, =E0 23:48 Europe/Paris, Chris Parker a =E9crit =
:
>
> On Wednesday, October 23, 2002, at 02:30 PM, Laurent Souef wrote:
>
>> Ok guys I've got the final word.
>>
>> It seems that movePath function does not allow you to override=20
>> existing files.
>> I changed my code to :
>>
>> [[NSFileManager defaultManager]=20
>> removeFileAtPath:calendarDatabaseFile handler:nil];
>> [[NSFileManager defaultManager] movePath:calendarFile=20
>> toPath:calendarDatabaseFile handler:nil];
>>
>> And it work. Yeah !!!
>> Special thanks to Nick and James for their support.
>>
>> Enjoy,
>> Laurent.
>>
>> PS / Apple guys if you listen to this talk, maybe you could add a=20
>> word on this limitation in the Cocoa documentation. Thx.
>
> Actually, it's there. ;)
>
> "The file specified in source must exist, while destination must not=20=
> yet exist."
>
> When I start running into problems like this, I usually install a=20
> handler object that implements fileManager:shouldProceedAfterError:=20
> and just dump the error dictionary to see what's in it. One of the=20
> errors you can get out of the errorDict is the fact that a file=20
> already exists at the destination.
>
> A lot of NSFileManager whackiness can be cleared up using a handler=20
> object in this manner.
>
> .chris
>
> --=20
> Chris Parker
> Cocoa Frameworks Engineer
> Apple Computer, Inc.
>
Laurent SOUEF
3 Hameau des Chaumettes
83440 Montauroux
France
Tel : (33) 4 94 39 11 40
| Related mails | Author | Date |
|---|---|---|
| Laurent Souef | Oct 23, 13:34 | |
| Laurent Souef | Oct 23, 14:35 | |
| Chris Parker | Oct 23, 14:48 | |
| Laurent Souef | Oct 23, 15:04 |






Cocoa mail archive

