Procedure:
OSStatus DoStupidCopy(char *pszSrcPath, char *pszDestDir)
{
static const int iBufSize= 4*4096;
char pBuf[iBufSize];
FILE* fSource = fopen(pszSrcPath,"rb");
if (!fSource)
return 1;//throw "Can't open file";
FILE* fTarget = fopen(pszDestDir,"wb");
if (!fTarget)
return 1;//throw "Can't write file";
int len;
while ( len = fread( pBuf, sizeof(char), iBufSize, fSource ) )
{
fwrite(pBuf, sizeof(char), len, fTarget);
}
fclose(fSource);
fclose(fTarget);
return noErr;
}
I've spent a lot of time to learn how to use MoreFilesX but I can't do
anything with it.
Beforehand thanks.
From the man page for fread:
---------------
The functions fread() and fwrite() advance the file position indicator
for the stream by the number of bytes read or written. They return the
number of objects read or written. If an error occurs, or the end-offile
is reached, the return value is a short object count (or zero).
The function fread() does not distinguish between end-of-file and error,
and callers must use feof(3) and ferror(3) to determine which occurred.
The function fwrite() returns a value less than nmemb only if a write
error has occurred.
---------------
Please rewrite your example to properly check the return values of fread
and fwrite, and if you still have a problem, ask again.
Also, don't forget Bundles (folders that the Finder presents as a
single, file-like object. For example, .framework files), and resource
forks.
He-he-dude)
RRRRRRRRRRRRRRRR!!!!!!!!!!!!!!!!
In this case how can I copy bundle? (Shared library made on codewarrior
compiler).
This file in Midnight commander is present as one file, and it's size
6 KB but in finder 16! After copying in MC it's size still 6 KB and
in finder too!
Sorry!
I'll kill myself by the wall!
This code works well in debugger... Source file size 6190 destination
file size 6190, in finder 16 KB! Have Mac OS some function which I can
use And copy it successful???
Also I tried to use: status = ::PBHCopyFileSync(¶mBlock) ;
But I got status is -50 for local volume.
Thanks.
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.
Thanks!!!
FUCK!
>
> FUCK!
So...nobody here...i feel so alone ...where ary yo, fishhead?Are you
dead?
Who am i?
Where is butthead?
So many questions...so few answers...so fuckingly few drugs...fuck...
mac!os!x!
aaaaa!
mac's!!!
it's so big!!!
Fuckin' cheese!!!
No more mushrooms!!!
sick my duck!
Chao!