473,799 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

back up data in C how & when in sudden poweroff??????? ??

Hi,

In sudden power off, How to backup means in which format(files,
streams) & when to backup in C.

Thanks,
SAI

Jul 24 '06 #1
11 1668
In article <11************ **********@s13g 2000cwa.googleg roups.com>,
<sk*******@yaho o.co.inwrote:
>In sudden power off, How to backup means in which format(files,
streams) & when to backup in C.
Unfortunately I don't understand your question, and the parts
of it that I think I understand would suggest that it isn't
really on topic for this newsgroup. Could you perhaps
expand on what you are trying to back up?

Are you asking how to save state information in a C program
so that you can restart the program at close to the same place
if you need to? And are you asking in particular how to save
state information about open files and streams? Or are you
asking whether you should save *to* a file or to a stream?
--
All is vanity. -- Ecclesiastes
Jul 24 '06 #2
Hello Roberson,

If i want to save the state information incaseof sudden power down,
which one is the better? Is it in File or in stream.

How do save to a file or to a stream?
Walter Roberson wrote:
In article <11************ **********@s13g 2000cwa.googleg roups.com>,
<sk*******@yaho o.co.inwrote:
In sudden power off, How to backup means in which format(files,
streams) & when to backup in C.

Unfortunately I don't understand your question, and the parts
of it that I think I understand would suggest that it isn't
really on topic for this newsgroup. Could you perhaps
expand on what you are trying to back up?

Are you asking how to save state information in a C program
so that you can restart the program at close to the same place
if you need to? And are you asking in particular how to save
state information about open files and streams? Or are you
asking whether you should save *to* a file or to a stream?
--
All is vanity. -- Ecclesiastes
Jul 24 '06 #3
sk*******@yahoo .co.in said:
Hi,

In sudden power off, How to backup
Too late.
means in which format(files, streams)
Whatever your application requires.
& when to backup in C.
Before the power fails.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jul 24 '06 #4
Hello Roberson,

If i want to save the state information incase of sudden power down,
which one is the better? Is it in File or in stream.
How do save to a file or to a stream?

Thanks ,
SAI.....
Walter Roberson wrote:
In article <11************ **********@s13g 2000cwa.googleg roups.com>,
<sk*******@yaho o.co.inwrote:
In sudden power off, How to backup means in which format(files,
streams) & when to backup in C.

Unfortunately I don't understand your question, and the parts
of it that I think I understand would suggest that it isn't
really on topic for this newsgroup. Could you perhaps
expand on what you are trying to back up?

Are you asking how to save state information in a C program
so that you can restart the program at close to the same place
if you need to? And are you asking in particular how to save
state information about open files and streams? Or are you
asking whether you should save *to* a file or to a stream?
--
All is vanity. -- Ecclesiastes
Jul 24 '06 #5
In article <11************ **********@m73g 2000cwd.googleg roups.com>,
<sk*******@yaho o.co.inwrote:
>Hello Roberson,
"Roberson" is my family name; "Walter" is my given name.

>If i want to save the state information incaseof sudden power down,
which one is the better? Is it in File or in stream.
As far as the C language itself is concerned, streams are the
only things that exist.

In standard C, you start out with three predefined streams (stdin,
stdout, and stderr) and you can [try to] create additional streams by
using fopen().

The name you pass to fopen() is interpreted by the operating
system, which might happen to consider it to be the name of a file,
but might happen to consider it to be the name of something else
(such as a device or network connection. The C language itself
(and the routines in the standard C library) do not provide any
way to find out what kind of object was accessed: all your
program knows about it is that a stream was provided to access
whatever the underlying object really is.

Accordingly, in standard C, the question of whether to save to
a file or a stream is not very meaningful.

If you go outside of the C standard, your operating system
may provide additional routines to access specific kinds of
objects, or may make additional guarantees about what names
will correspond to what kind of objects: anything like that is
an extension to C, and the details of the extensions need to be
explored in a newsgroup more specific to your operating system.
*Generally* speaking, if you are in emergency powerfail operations,
then you do not have time to wait for a network connection to
be created (as that could take several minutes or might not
be available at all), so you usually want to save information to
something local. You probably want to save a minimal amount of
information as soon as possible, and possibly expand upon that if
you manage to get some spare time. You want the saved information
to be left in a consistant state, so you want to avoid having
a file open and being written to when the computer and operating
system run out of grace time, so your strategy might involve
several files.
--
All is vanity. -- Ecclesiastes
Jul 24 '06 #6
>If i want to save the state information incase of sudden power down,
>which one is the better? Is it in File or in stream.
In C, what's the difference between a file and a stream?
>How do save to a file or to a stream?
C provides a number of functions for this, such as fprintf(),
fwrite(), fputc(), etc. However, there is no particular guarantee
that what you are writing to isn't a volatile file system (RAM
disk or similar) that will lose its memory on powerdown, nor is
there any guarantee that when fprintf() returns, the data has
actually made it to the disk drive, or that after it has made it
to the disk drive, it's actually written on disk (as opposed to
an on-drive cache).

Gordon L. Burditt
Jul 24 '06 #7
sk*******@yahoo .co.in wrote:
Hi,

In sudden power off, How to backup means in which format(files,
streams) & when to backup in C.

Thanks,
SAI
When somebody kicks your plug out of the wall, you are hosed. All that
power-off stuff is done by the BIOS and/or OS and they won't tell you.
There is nothing to do. R.I.P.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Jul 25 '06 #8
In article <iY************ *************** ***@comcast.com >,
Joe Wright <jo********@com cast.netwrote:
>When somebody kicks your plug out of the wall, you are hosed. All that
power-off stuff is done by the BIOS and/or OS and they won't tell you.
There is nothing to do. R.I.P.
Your answer is written in absolute terms -- you used the word "all"
and made the specific claim "they won't tell you".

Anything to do with power failure notification is system specific
and in comp.lang.c one should not assume any particular system
behaviour.

It so happens that your statement is incorrect on some operating
systems, including SGI IRIX and including Linux.
http://en.wikipedia.org/wiki/SIGPWR
http://wlug.org.nz/SIGPWR

--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
Jul 25 '06 #9
On Tue, 25 Jul 2006 15:37:21 +0000 (UTC), in comp.lang.c ,
ro******@ibd.nr c-cnrc.gc.ca (Walter Roberson) wrote:
>It so happens that your statement is incorrect on some operating
systems, including SGI IRIX and including Linux.
.... and Windows. However typically unless you have a UPS or other
battery supply, you get about a hundredth of a second to do anything
in any OS...
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 25 '06 #10

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

Similar topics

4
2818
by: MLH | last post by:
A programmer developed an AMP (Apache/MySQL/PHP) application for me. When he was done, he sent me the PHP files and the MySQL dump file. Now, when I connect to the application on my LAN using http://192.168.1.106/~mlh/credifree/index.php the AMP app still thinks the data resides somewhere else. It runs fine - as long as I leave my LAN's external internet connection up. But if I unplug my LAN from the world, my app locks up. Before I...
7
5548
by: BlueDragon | last post by:
I don't know enough math to demonstrate that any numerical operation with a null should yield a null; although I would guess that it's true. I just don't buy it, however, when dealing with strings and nulls. In a simple table with first, middle and last name columns, I would infer that a null value in the middle name column means the HR person forgot to ask. A zero length string, however, tells me HR did ask and there is no middle name....
19
2723
by: jameso321 | last post by:
Hi, We run an MS Access 2000 DB with about 15 users. It is on a Win 2000 Server (SP4) machine and runs through Citrix Metaframe Presentation Server 3.0. --------------------------
4
3155
by: Murali Krishna. Siruvuru | last post by:
Hi, All of a sudden, all my Button Controls and Image Button Controls are not posting back data. I have Click event and event handlers in the code. Page itself is not posting back. Whereas Linkbuttons are working fine.
5
4340
by: David Bartosik [MSFT MVP] | last post by:
I'm parsing an XML file with XMLDocument, each node I write to SQL server. Sometimes values in the XML have to contain an ampersand, so they are in the XML as &amp; obviously. I assumed the .net framework took care of converting &amp; back to & But I'm wrong in that assumption. For every &amp; in the XML I receive
2
1208
by: fatica | last post by:
Hi all, I've written a windows service in .net 2.0 running on a windows 2003 server. I've hooked the system timer elapsed event to run some very time consuming code. This code processes a list of jobs and when its done, clears out that list. However, when the code takes longer to execute than the timer interval, all heck breaks loose. The elapsed code is fired again, yet, its still working on the list. What exactly has happened...
2
1263
by: skishorev | last post by:
Hi, In sudden power off, How to backup means in which format(files, streams) & when to backup in C++. Thanks, SAI
23
14523
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of the visitors will retype it all so i'm asking: "how to preserve POST-data when clicking the back-button?" i've already tried to print post data as a value in a HTML tag but
4
5699
by: Sin Precedente | last post by:
I have a win2k server with multiple domains on it many of which have a generic contact us page with a form that when submitted calls an .asp page that utilizes CDONTS. These pages have worked extremely well in the past until a couple days ago when all of a sudden every time that page is called i'm getting event 4000 in source smtpsvc Message delivery to the remote domain 'mydomain.com' failed for the following reason: Unable to bind to...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9078
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.