|
From: Alain S. <asp...@gm...> - 2011-10-31 09:43:50
|
On Mon, Oct 31, 2011 at 9:12 AM, Stef Bon <st...@gm...> wrote:
> Hi,
>
> well teh problem is what should the reaction of the fs if writing to
> an offset which exceeds the filesize, for example to a file with zero
> size. Should it just append?
try , using your favourite scripting language
mine is python :
>>> import os
>>> fd=os.open('/tmp/test',os.O_RDWR|os.O_CREAT|os.O_TRUNC)
>>> os.lseek(fd, 10, os.SEEK_SET)
10
>>> os.write(fd,'hello')
5
>>> os.close(fd)
>>> open('/tmp/test', 'r').read()
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00hello'
File is automatically filled of zeros. truncate() does the same.
>
> Stef
>
> 2011/10/30 Sebastian Pipping <seb...@pi...>:
>> On 10/21/2011 12:26 PM, Stef Bon wrote:
>>> When writing data to a file with zero size, what should the action be?
>>> Should the fs detect
>>> that it has not enough blocks (in this case 0) and create them first,
>>> and then do the write?
>>
>> Maybe explain that in more detail or other words. I may not be the only
>> one who fails to get your question - not sure.
>>
>> Best,
>>
>>
>>
>> Sebastian
>>
>> ------------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Get your Android app more play: Bring it to the BlackBerry PlayBook
> in minutes. BlackBerry App World™ now supports Android™ Apps
> for the BlackBerry® PlayBook™. Discover just how easy and simple
> it is! http://p.sf.net/sfu/android-dev2dev
> _______________________________________________
> fuse-devel mailing list
> fus...@li...
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>
--
Alain Spineux | aspineux gmail com
Monitor your iT & Backups | http://www.magikmon.com
Free Backup front-end | http://www.magikmon.com/mksbackup
Your email 100% available | http://www.emailgency.com
|