See comments inline. Also, in the future, it might be useful to indicate: 1. Mac OS X version 2. arch (x86, ppc, x86_64, ppc64) 3. MacFUSE version
On Thu, Oct 30, 2008 at 12:58 PM, Alex <[EMAIL PROTECTED]> wrote: > > I've been having a lot of trouble creating a writable filesystem using > the objective-c framework. The filesystem is remote, the contents are > stored on a website. I have gotten reading to work fine, but getting > files to be written back has not been working, and I'm not entirely > sure where to go from here. I'm not sure if I'm not implementing a > function I need to be, or if I'm implementing one of the core > functions incorrectly. That is most likely the explanation. I'm being vague on purpose here because it is not easy to tell what the problem is without seeing the code. If you are doing a read-only file system you can often get away with leaving out implementations of some of the delegate methods; the GMUserFileSystem code will try to do something reasonable to fill in for you. When adding write support, you typically need to implement almost all of the delegate methods and have them return proper error codes, etc. Write support is almost all-or-nothing and not very forgiving, especially when it comes to operations done through the Finder. > > What I want to be able to do is write that file over the server online > and have the file appear in the mounted filesystem. I'm assuming I > should put this logic in the writeFileAtPath function, but I haven't > been able to get this function to be called yet. writeFileAtPath will be called when data is being written to your file. However, other required delegate methods may be called by whatever is doing the file copy before this, and if they fail it may not even get to the point of writing the file. > > Right now, I mount the filesystem and then try to copy and paste a new > file into the root directory of the filesystem. I put logging to know > what functions are being called. This is the output that I get: > > In atts of item: /textDoc.txt > Item not found...: /textDoc.txt > In atts of item: / > In atts of item: /textDoc.txt > Item not found...: /textDoc.txt > In create file at path2 > In atts of item: /textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /textDoc.txt > In atts of item: /textDoc.txt > In atts of item: /._textDoc.txt > In create file at path2 > In atts of item: /._textDoc.txt > In atts of FS: / > In atts of FS: / > In atts of FS: / > In atts of FS: / > In contents of dir: / > In atts of FS: / > In atts of FS: / > In atts of FS: / > In atts of item: /Test.txt > In atts of item: / > In atts of FS: / > In atts of FS: / > In atts of item: /._Test.txt > In contents of dir: / > In atts of item: / > In atts of item: /._Test.txt > In atts of item: /aaaa.txt > In atts of FS: / > In atts of FS: / > In contents of dir: / > In atts of item: / > In atts of FS: / > In contents of dir: / > In atts of FS: / > In atts of item: /._Test.txt > In atts of item: /._Test.txt > In atts of item: /._aaaa.txt > In atts of item: /._Test.txt > In atts of item: /._Test.txt > In atts of item: /._Test.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._Test.txt > In atts of item: / > In atts of FS: / > In atts of item: /._aaaa.txt > In atts of item: /._textDoc.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In atts of FS: / > In atts of item: /._textDoc.txt > In atts of item: /._aaaa.txt > In atts of item: /Test > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._Test > In atts of item: /Test2.txt > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._Test2.txt > In atts of item: /._Test > In atts of item: /._textDoc.txt > In atts of item: /._Test > In atts of item: /._Test2.txt > In atts of item: /._Test > In atts of item: /._Test2.txt > In atts of item: /._Test2.txt > In atts of item: /.hidden > In atts of item: /._Test2.txt > In atts of item: /._Test2.txt > In atts of item: /._Test2.txt > In atts of item: /.DS_Store > In atts of item: /.hidden > In atts of item: /.hidden > In atts of item: /._Test2.txt > In atts of item: /.DS_Store > In atts of item: /.DS_Store > In atts of item: /.hidden > In atts of item: /.DS_Store > In atts of FS: / > In atts of FS: / > In atts of FS: / > In atts of FS: / > In contents of dir: / > In atts of item: /._Test.txt > In atts of item: /._Test.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._Test > In atts of item: / > In atts of item: /._Test2.txt > In atts of item: /._Test2.txt > In atts of item: /.DS_Store > In atts of item: /._aaaa.txt > In atts of FS: / > In atts of FS: / > In atts of item: /._textDoc.txt > In atts of FS: / > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In contents at path /aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In contents at path /aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._Test2.txt > In contents at path /Test2.txt > In atts of item: /._Test2.txt > In atts of item: /._Test.txt > In contents at path /Test.txt > In atts of item: /._Test.txt > > At this point I get a message that says: "You cannot copy some of > these items to the destination because their names are too long or > contain invalid characters for the destination. Do you skip copying > these items and continue copying the other items?" This indicates to me that you are doing your test using the Finder. The Finder is extremely picky and performs a lot of write-like operations (chown, chmod, etc) for any given task. If any of these fails it will throw up an error message. In my experience, the error message it throws up is often misleading. It may complain about "names are too long" but probably in this case there is some other underlying error that it is seeing. My suggestion when implementing a write-able file system is to get things working with typical command-line operations first. Try things to test basic create, write, chmod, truncate, etc. like: touch /Volumes/myfs/foo.txt echo "blah" > /Volumes/myfs/foo.txt chmod 777 /Volumes/myfs/foo.txt echo -n > /Volumes/myfs/foo.txt cp /tmp/bar /Volumes/myfs/foo.txt Get these basics working first and then try to experiment with the Finder. You may still be missing something, but it might save you some headache and puzzling when you jump directly to attempting a Finder-compatible file system. > > If I click skip I get the following: > In atts of item: / > In atts of FS: / > In contents of dir: / > In atts of item: /Test.txt > In atts of item: /._Test.txt > In atts of item: /._Test.txt > In atts of FS: / > In atts of item: /aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /._textDoc.txt > In atts of item: /Test > In atts of item: /._Test > In atts of item: /Test2.txt > In atts of item: /._Test2.txt > In atts of item: /._Test2.txt > In atts of item: /.DS_Store > In atts of item: / > In atts of FS: / > In atts of item: /._aaaa.txt > In atts of FS: / > In atts of FS: / > In atts of FS: / > In contents at path /aaaa.txt > In atts of item: /._aaaa.txt > In atts of item: /._textDoc.txt > In contents at path /textDoc.txt > In atts of item: /textDoc.txt > In contents at path /textDoc.txt > In atts of item: /textDoc.txt > In contents at path /textDoc.txt > In atts of item: /._Test2.txt > In contents at path /Test2.txt > In atts of item: /._Test2.txt > In atts of item: /._Test.txt > In contents at path /Test.txt > In atts of item: /._Test.txt > > writeToPath is never called so I can never send the data to the > server. Any ideas on what I might be doing wrong? Try my suggestions and then post the results to this list. If you still have problems, list all of the delegate methods that you think your FS implements. Also, do you happen to return a fileDelegate in the out parameter to create/open? If so, it may be calling write on the fileDelegate. ted > > Thanks, > Alex > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MacFUSE" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/macfuse?hl=en -~----------~----~----~----~------~----~------~--~---
