FSAllocateFork

  • I copy a file to a remote AFP disk using the routines from FSCopyObject.c.
    When the file is > 2GB the API FSAllocateFork always returns an error -34
    (disk full) even if the AFP remote disk has 4 GB free space.
    So as I have read on the web, I have omitted FSAllocateFork .
    It seems to work ok even with old MacOS 9 files with resource forks.
    Do you think this omission could cause some problem?
    I check the destination disk space using the new Cocoa APIs.

    Best Regards
    --
    Lorenzo
    email: <archidea...>
  • This is likely due to the fact you cannot have a larger than 2gig
    file on these formats.

    On Mac OS X 10.4 or later, you can use FSCopyObjectSync() instead of
    the sample code. FSAllocateFork() is for preallocating space on
    volumes formats that support it. This can speed up the write. For AFP
    volumes, I'm not sure if it matters.

    Ack, at 10/6/06, Lorenzo said:

    > I copy a file to a remote AFP disk using the routines from FSCopyObject.c.
    > When the file is >  2GB the API FSAllocateFork always returns an error -34
    > (disk full) even if the AFP remote disk has 4 GB free space.
    > So as I have read on the web, I have omitted FSAllocateFork .
    > It seems to work ok even with old MacOS 9 files with resource forks.
    > Do you think this omission could cause some problem?
    > I check the destination disk space using the new Cocoa APIs.

    --

    Sincerely,
    Rosyna Keller
    Technical Support/Holy Knight/Always needs a hug

    Unsanity: Unsane Tools for Insanely Great People

    It's either this, or imagining Phil Schiller in a thong.
  • With a modern AFP server, you can store very large files without issues.
    (10GB+ in my experience.)
    Is the file server a Mac OS X machine or a Windows machine?

    Rosyna wrote:
    > This is likely due to the fact you cannot have a larger than 2gig file
    > on these formats.
    >
    > On Mac OS X 10.4 or later, you can use FSCopyObjectSync() instead of
    > the sample code. FSAllocateFork() is for preallocating space on
    > volumes formats that support it. This can speed up the write. For AFP
    > volumes, I'm not sure if it matters.
    >
    > Ack, at 10/6/06, Lorenzo said:
    >
    >> I copy a file to a remote AFP disk using the routines from
    >> FSCopyObject.c.
    >> When the file is > 2GB the API FSAllocateFork always returns an error
    >> -34
    >> (disk full) even if the AFP remote disk has 4 GB free space.
    >> So as I have read on the web, I have omitted FSAllocateFork .
    >> It seems to work ok even with old MacOS 9 files with resource forks.
    >> Do you think this omission could cause some problem?
    >> I check the destination disk space using the new Cocoa APIs.
    >
  • The server could be a MacOS X volume, a Windows volume, a WebDave volume,
    ... any kind of volume as well as the Finder can copy files to.
    I am going to try the API FSCopyObjectSync() and verify whether it can fix
    my needs. Thank you for the suggestion.

    Anyway, after talking with some colleaugue, I suppose that the API
    FSAllocateFork has really a bug since it fails to detect the right
    destination disk free space in case of copying files larger than 2GB. It
    always returns error -34 (disk full) even when the disk has indeed free
    enough free space to copy the file to.

    Best Regards
    --
    Lorenzo
    email: <archidea...>

    > From: John Stiles <JStiles...>
    > Date: Sat, 07 Oct 2006 14:10:24 -0700
    > To: Rosyna <rosyna...>
    > Cc: Lorenzo <archidea...>, <cocoa-dev...>
    > Subject: Re: FSAllocateFork
    >
    > With a modern AFP server, you can store very large files without issues.
    > (10GB+ in my experience.)
    > Is the file server a Mac OS X machine or a Windows machine?
    >
    >
    > Rosyna wrote:
    >> This is likely due to the fact you cannot have a larger than 2gig file
    >> on these formats.
    >>
    >> On Mac OS X 10.4 or later, you can use FSCopyObjectSync() instead of
    >> the sample code. FSAllocateFork() is for preallocating space on
    >> volumes formats that support it. This can speed up the write. For AFP
    >> volumes, I'm not sure if it matters.
    >>
    >> Ack, at 10/6/06, Lorenzo said:
    >>
    >>> I copy a file to a remote AFP disk using the routines from
    >>> FSCopyObject.c.
    >>> When the file is > 2GB the API FSAllocateFork always returns an error
    >>> -34
    >>> (disk full) even if the AFP remote disk has 4 GB free space.
    >>> So as I have read on the web, I have omitted FSAllocateFork .
    >>> It seems to work ok even with old MacOS 9 files with resource forks.
    >>> Do you think this omission could cause some problem?
    >>> I check the destination disk space using the new Cocoa APIs.
    >>
  • On Oct 7, 2006, at 2:33 PM, Lorenzo wrote:
    > The server could be a MacOS X volume, a Windows volume, a WebDave
    > volume,
    > ... any kind of volume as well as the Finder can copy files to.
    > I am going to try the API FSCopyObjectSync() and verify whether it
    > can fix
    > my needs. Thank you for the suggestion.

    Just a word of warning;  you really do not want to treat a WebDAV
    volume like a regular filesystem.  It simply won't work for anything
    but the smallest of files (transactions).  WebDAV generally doesn't
    properly deal with partial transactions and you are going to be stuck
    doing massive transactions for even a few bytes change.

    If you really do need to use WebDAV, test the hell out of it.

    b.bum
  • b.bum wrote:

    > Just a word of warning;  you really do not want to treat a WebDAV
    > volume like a regular filesystem.

    This is something I think most developers understand - but average
    users certainly don't.....

    > If you really do need to use WebDAV, test the hell out of it.

    ...and since Apple allows users to mount webdav volumes, users expect
    3rd party apps to work well with it.

    Ross.
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today