473,382 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

fdatasync() does not work

Hi,

I have a problem useing fdatasync()…

This is how it goes.

Setup:

I have an external device connected through Firewire,
I am running Redhat 2.4.
I write to it in raw initiated mode (no File System)

Scenario:

I open the device using open() get a file descriptor. (flag set to
O_SYNC)
I write a block in a while loop using write()
I call fdatasync() and check for success response in each loop
I close using close()

Now in this code if I disconnect the firewire cable during the loop I
loose all the data.

This tells me fdatasync() did not work. however if i have a 1sec sleep
after each write i do get all the data on my disk but kills the
throughput(sleep is not an option).

Any clue why?

Please assist….

Adnan Abbas
Nov 14 '05 #1
2 1896
In article <d1**************************@posting.google.com >,
ad****@gmail.com (Adnan Abbas) wrote:
Hi,

I have a problem useing fdatasync()…

This is how it goes.

Setup:

I have an external device connected through Firewire,
I am running Redhat 2.4.
I write to it in raw initiated mode (no File System) I open the device using open() get a file descriptor. (flag set to
O_SYNC)
I write a block in a while loop using write()
I call fdatasync() and check for success response in each loop
I close using close()

Now in this code if I disconnect the firewire cable during the loop I
loose all the data.

This tells me fdatasync() did not work. however if i have a 1sec sleep
after each write i do get all the data on my disk but kills the
throughput(sleep is not an option).

Any clue why?


Perhaps you should go to a Linux group -- this is a heavily
platform-specific bug, and is off-topic for comp.lang.c.

Cheers,
- jonathan
Nov 14 '05 #2
Adnan Abbas <ad****@gmail.com> wrote:
I have a problem useing fdatasync()… This is how it goes. Setup: I have an external device connected through Firewire,
I am running Redhat 2.4.
I write to it in raw initiated mode (no File System)


As have already been told that kind of stuff is off-topic here.
<OT> Read the man page for fdatasync() carefully, perhaps you
get an idea once you realize that it's talking about "files"
all of the time and you compare that to the "(no File System)"
you wrote yourself above. Add to that that a device file isn't
a normal regular file.</OT>
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Nov 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
1
by: Adnan Abbas | last post by:
Hi, I have a test app that writes to a device in raw initiated mode (RedHat 2.4) I use open() with O_SYNC flag I call write() in a loop. I call fdatasync(fd) in each loop (check for success...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.