>> No. At the BSD layer, when you create a file and starting appending >> data to it you don't inform the operating system how big the file will >> eventually be. Since MacFUSE is really implementing a file system, it >> is bound to the same BSD/POSIX model. >> > > For my particular file system, it would be valuable to have knowledge > of the source file; I need the size as a parameter inside my > implementation of createFileAtPath. Maybe I'll need to add this into > fuse so I can expose the path of the file on the local mac and use an > NSFileManager to learn about it. When a user drags a file into my file > system and createFileAtPath is triggered, does fuse have any knowledge > of this file like the path for example? Or does the finder just > provide a raw stream of data?
The underlying BSD layer doesn't support notifying you just how big the thing it wants to write is, which is what Ted just said. The system may not itself know how big the thing is until it writes it (log files are a good example of this). Sometimes it would be great knowledge to have, imagine what you could do if you knew someone was going to dump a 700MB file on your disk, think of all of the interesting fragmentation avoidance work you couuld do with that information for stuff like bittorrents (usually avoided by those applications by 'preallocating' the data and filling it in themselves as they go but the FS could make a poor decision here and fragment your nice Linux ISO badly). All you know is that something wants to create a file at that location, its that generic because it has to; going back to the log file example, it doesn't exist else where because until someone touches the service the log entry doesn't exist yet. Extending the system is more than likely going to be pointless (though someone greater than I should validate this) because once it hits the kernel anything like this is going to be ignored anyway because the API isn't there. > > Here's a good example of why this would be handy: If the capacity of > the file system is not known, and I copy 100G of data to it, only to > find out I have 99.99G available and it fails after 15h of copying. > But if in createFileAtPath (or writeFileAtPath) I know my size of my > file I can save the user allot of time by raising an exception early. This is usually worked around by asking your filesystem how much space you have left and notifying the user that there isn't enough space left to complete the operation before it starts. Other tools (such as cp) will blindly start copying data until you raise an error in your FS. Finder will check this and prevent the user from doing just such an operation if it believes that it will run out of disk space. Sam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
