Overwrite instead of append to the text file on mounted volume?

61 views
Skip to first unread message

Nickolay Olshevsky

unread,
Mar 12, 2015, 12:46:03 PM3/12/15
to osxfus...@googlegroups.com
Hi guys,
I'm struggling with a weird problem. I'm trying to issue command echo "Hello world" >> hello.txt on the mounted volume.
And, instead of appending text to the file it just writes to the beginning.
On fuse files system delegate I'm receiving just two callbacks:
open() with O_WRONLY
and write() with 0 offset and the data itself.

Am I missing something simple?

Using version 2.7.4 of OSX FUSE.

Thanks,
  Nickolay Olshevsky.

Sam Moffatt

unread,
Mar 12, 2015, 10:43:50 PM3/12/15
to osxfus...@googlegroups.com
Are you sure you aren't seeing a stat on that path?

--
Sam Moffatt

Note: I'm not at my desk, responses may be delayed. Apologies for the typos, smartphones aren't all that smart. 

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nickolay Olshevsky

unread,
Nov 24, 2015, 1:48:24 PM11/24/15
to OSXFUSE
Sorry for a such long delay with reply, got buried under the other stuff and mislooked your reply.
Now got back to the issue, and here is what I'm experiencing:

- got 10-byte long file. WIth some text ('hello here').
- doing echo "17" >> ...filepath
- getting the same 10-byte long file, with text '17' at the beginning, and LF symbol after it. The rest of file is unchanged.

So it is not something expected, however no any 'append' flags mentioned and offset in writeFileAtPath: is zero.

My log of FUSE calls follows (I'm using  Objective-C API):


[41495] 2015-11-24 18:39:40 +0000 : FuseFileSystem: attributesOfItemAtPath:/Nickolay TestUpload/1.txt userData: (null)
[41495] 2015-11-24 18:39:40 +0000 : Returning attributes : {
NSFileCreationDate = "2015-11-13 16:17:22 +0000";
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2015-11-24 18:37:56 +0000";
NSFileOwnerAccountName = nickolay;
NSFilePosixPermissions = 384;
NSFileSize = 10;
NSFileSystemNumber = 16777220;
NSFileType = NSFileTypeRegular;
kGMUserFileSystemFileAccessDateKey = "2015-11-13 16:17:22 +0000";
}
[44035] 2015-11-24 18:39:40 +0000 : FuseFileSystem: openFileAtPath:/Nickolay TestUpload/1.txt mode:O_WRONLY (1)
[40735] 2015-11-24 18:39:40 +0000 : FuseFileSystem: writeFileAtPath:/Nickolay TestUpload/1.txt userData:<FuseFileData: 0x600000030580> size:3 offset:0
[44035] 2015-11-24 18:39:40 +0000 : FuseFileSystem: releaseFileAtPath:/Nickolay TestUpload/1.txt : userData released.
[40735] 2015-11-24 18:39:40 +0000 : FuseFileSystem: attributesOfItemAtPath:/Nickolay TestUpload/1.txt userData: (null)
[40735] 2015-11-24 18:39:40 +0000 : Returning attributes : {
NSFileCreationDate = "2015-11-13 16:17:22 +0000";
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2015-11-24 18:39:40 +0000";
NSFileOwnerAccountName = nickolay;
NSFilePosixPermissions = 384;
NSFileSize = 10;
NSFileSystemNumber = 16777220;
NSFileType = NSFileTypeRegular;
kGMUserFileSystemFileAccessDateKey = "2015-11-13 16:17:22 +0000";
}

-- 
  Nickolay Olshevsky
Reply all
Reply to author
Forward
0 new messages