Here is the test i performed:

To test whether the file is being written out to the disk,
- i mount a usb thumb drive
- copy a file into the mounted usb partition and call fsync() before
closing the fd
- when the process is complete, disconnect the pen drive (without umount'ing)
- connect and mount it again and check if the file exists and is
copied correctly.

Regards
~Sameer

2010/9/16 Sameer Naik <[email protected]>:
> Please find attached.
> P.S. I have added the fflush () call before the fsync () call.
>
> Regards
> ~Sameer
>
> 2010/9/15 Jean-Pierre André <[email protected]>:
>> Hi,
>>
>> JD wrote:
>>>
>>>
>>> On 09/15/2010 03:21 AM, [email protected] wrote:
>>>
>>>> Re: fsync() does not write out the file to the disk (Sameer Naik)
>>>>
>>> My current installation of ntfs-3g-2010.8.8-2.fc13.i686 does not exhibit
>>> this behaviour, albeit, I am not using my own C program to
>>> copy a file to an ntfs partition. I am just using /bin/cp.
>>> I have my windows xp partition mounted as /sda1.
>>>
>>
>> Maybe because cp does a fsync() (I have not checked).
>>
>>> $ ls -l /tmp/nss-deplists.txt
>>> -rw-r--r-- 1 jd jd 72247 Sep 15 08:10 /tmp/nss-deplists.txt
>>> $ cp /tmp/nss\-deplists.txt /sda1/Tmp; sudo umount /sda1; sudo mount
>>> /sda1; ls -l /sda1/Tmp/nss*
>>> -rwxrwxrwx 1 jd jd 72247 Sep 15 08:32 /sda1/Tmp/nss-deplists.txt
>>>
>>> Where can I find Sameer's test program to see the problem for myself?
>>>
>>
>> It was attached to his original post on this list
>> (which I received on Aug 24 1:03pm - must mean
>> 11:03 am UTC).
>> Just add a fflush(outfile) before the fsync().
>>
>> If you cannot get it, ask again.
>>
>> Regards
>>
>> Jean-Pierre
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Start uncovering the many advantages of virtual appliances
>> and start using them to simplify application deployment and
>> accelerate your shift to cloud computing.
>> http://p.sf.net/sfu/novell-sfdev2dev
>> _______________________________________________
>> ntfs-3g-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
>>
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to