On Wed, Dec 10, 2008 at 6:13 AM, iDeveloper <[EMAIL PROTECTED]> wrote: > > Hi > > I am very close to implementing write (finally!!). Just one thing > stopping me. > When I do a save operation, I get this message in the writeToFile > method > > *** -[GMDataBackedFileDelegate longValue]: unrecognized selector sent > to instance 0x16cb30f0 > > I am using an implementation similar to the one in LoopbackFS and > assigning an NSNumber to the fileDelegate property when a file is > created. > I understand that this would happen if the value for fileDelegate was > not retained. Or is there some other problem?
Is there any chance that you'd switch to targeting MacFUSE 2.0+? I'm not saying that it would solve this particular issue, but it would make it easier for me to try and help you debug. The GMDataBackedFileDelegate is a class that is internal to the framework. I added that to solve someone else's problem; I can't even recall what it was. I think this is only used if you are using the contentsAtPath: method on the read side. If you are doing a writeable file system then you should not be using the "contentsAtPath:" shortcut. You should be implementing openFileAtPath: and readFileAtPath:. The new project templates in MacFUSE 2.0 might help you a bit; try using the Objective-C File System (Read-Write) template. Be careful not to accidentally overwrite your old project by naming it the same thing! ted > > Thanks. > > On Dec 6, 3:52 am, "ted bonkenburg" <[EMAIL PROTECTED]> wrote: >> On Fri, Dec 5, 2008 at 8:52 AM, iDeveloper <[EMAIL PROTECTED]> wrote: >> >> > Hi Ted >> >> > I implemented setAttributes like you told me to. Not returning a YES >> > for everything now without checking. >> >> I'm not sure what you mean by checking. You should be setting the >> requested attributes on the files in your file system. >> >> >> >> > I still cannot save files edited using vi or TextEdit. >> > But if I drag-drop files, the file is getting created at the server to >> > which I can later append the data. How can I get the contents of the >> > file which was dragged into the FS? >> >> When you copy a file into your file system you should see a create >> operation followed by a series of writes. >> >> The "Save As" procedure for a file within your file system can be >> somewhat complicated. See: >> >> Seehttp://groups.google.com/group/macfuse/msg/46c6c4012ec339c3 >> >> ted >> >> >> >> > Thanks again for all your help. >> >> > On Dec 3, 8:25 pm, iDeveloper <[EMAIL PROTECTED]> wrote: >> >> Hi Ted >> >> >> I still don't really get it. Do I check what attributes are coming in >> >> as arguments and change them before returning a value? >> >> >> I'm using version 1.7 >> >> >> On Dec 2, 3:33 am, "ted bonkenburg" <[EMAIL PROTECTED]> wrote: >> >> >> > On Mon, Dec 1, 2008 at 8:00 AM, iDeveloper <[EMAIL PROTECTED]> wrote: >> >> >> > > Hi Ted >> >> >> > > I got the read to work along with copying files from the FS to the >> >> > > local file system, both through Finder and the command line. >> >> >> > Great. >> >> >> > > I have implemented the setAttributes:ofItemAtPath method, but I >> >> > > noticed it is only called once or twice and that too for files created >> >> > > by finder. >> >> >> > Yes, this won't be called that often. It is called when something is >> >> > updating an attribute of your file, for example 'chmod', 'chown', >> >> > 'utimes', etc. If you are using the developer release of MacFUSE then >> >> > you will see that it is also called when the file is 'truncated'. >> >> >> > > What should I have in setAttributes? Aren't we setting the attributes >> >> > > for files in attributesOfItemAtPath. At present I'm just returning a >> >> > > YES in setAttributes >> >> >> > Think of it this way. In attributesOfItemAtPath you are reporting on >> >> > the attributes of a file or directory. This is a "read" operation. The >> >> > system is reading what the current attributes for the file are. With >> >> > setAttributes you are setting the attirbutes of a file or directory in >> >> > your file system. This is a "write" operation. The system is setting >> >> > something about your file, and so your file system needs to update the >> >> > file accordingly. >> >> >> > Returning YES without doing anything else is claiming that you are >> >> > updating the file when you actually aren't. It is recommended that you >> >> > actually see what attributes are being set and update your files as >> >> > necessary. In some cases it does work to satisfy the Finder to just >> >> > return YES, but this can lead to strange issues down the road that are >> >> > hard to debug. Think of it as 'chmod' claiming success but not >> >> > actually chmod'ing the file. >> >> >> > > What should be my next step for implementing thewritefunction? >> >> >> > It would be a good idea to implement setAttributes fully, as described >> >> > above. >> >> >> > What version of MacFUSE are you targeting? >> >> >> > ted > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
