Hello Marshall ,
Thanks for reply.
Yes that is wrong.
flag = CFURLGetFSRef((CFURLRef)url , &ref); >result = FSGetDataForkName(&dataForkName); >result = FSOpenFork(&ref, dataForkName.length, dataForkName.unicode, >fsRdPerm, &forkRefNum); >if (result == noErr) > { > result = FSGetForkSize(forkRefNum, &forkSize);
if(result !== noErr)
{
//some code
} > else if (result == noErr) //this is another condition for reading. > { Err1= FSReadFork(forkRefNum,fsFromStart,0, forkSize,&forkData, &actualCount);
//here Err1 returns 0 means successfull
}
But I could not understand that how should I read the data if sie written is logical size
Physical size of a file is 4KB i.e 406 bytes , but
logical size written is 998 bytes.
and file format is like:-
8957
9011
2345
etc. --- On Thu, 26/6/08, Marshall Clow <email@hidden> wrote:
From: Marshall Clow <email@hidden> Subject: Re: Error for FSReadFork To: email@hidden, email@hidden Date: Thursday, 26 June, 2008, 7:29 PM
At 9:53 AM +0530 6/26/08, pallavi khutal wrote:
>Hello All ,
> Using FSReadFork I want to read a text file but while reading that
>returns error code like --4628 ,-4132,-5380 etc.
>Following code I am using for opening and reading file.
>FSOpenFork return successfully, but for FSReadFork is unuccessfull.
>
[ snip ]
>flag = CFURLGetFSRef((CFURLRef)url , &ref);
>result = FSGetDataForkName(&dataForkName);
>result = FSOpenFork(&ref, dataForkName.length, dataForkName.unicode,
>fsRdPerm, &forkRefNum);
>if (result == noErr)
> {
> result = FSGetForkSize(forkRefNum, &forkSize);
> if (result != noErr)
> {
Shouldn't this be "result == noErr" ?
--
-- Marshall
Marshall Clow Idio Software <mailto:email@hidden>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion. |