1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<title>NAND Sample Demo Cancel</title>
9</head>
10
11<body>
12
13<H1>cancel</H1>
14
15<H2>Location</H2>
16<p>
17<CODE>$REVOLUTION_SDK_ROOT/build/demos/nanddemo</CODE>
18</p>
19
20<H2>Description</H2>
21<p>
22This demo shows an example of handling errors with the <CODE><a href="../NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a></CODE> function when using the NANDSimpleSafe type of functions.
23</p>
24<p>
25<CODE>NANDSimpleSafeOpen[Async]</CODE> and <CODE>NANDSimpleSafeClose[Async]</CODE> asynchronously open a file in a manner that guarantees the atomic nature of file updates. However, to implement this process, multiple requests of various types (Open, Close, Read, Write, Create, Delete, Seek, and so on) are executed inside these functions. If these requests cannot be processed normally, NANDSimpleSafe functions will immediately return the error code to the caller. However, they will not free the resources (temporary files, file descriptors, and so on.) that are being used. If the <code>NAND_RESULT_AUTHENTICATION</code> or <code>NAND_RESULT_ECC_CRIT</code> error codes are issued with the NANDSimpleSafe functions, the application program should call the <CODE>NANDSimpleSafeCancel[Async]</CODE> function and try to free resources.
26</p>
27
28<h3>Process Flow</h3>
29<p>
30The basic process flow of this sample program is as follows.
31<ol>
32<li>Create a file in the home directory and write the appropriate data to it.
33<li>Open the file using <CODE><a href="../NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a></CODE>.
34<li>Write data to the file using <CODE><a href="../NANDWrite.html">NANDWrite</a></CODE>.<BR>
35<li>Close the file with <CODE><a href="../NANDSimpleSafeClose.html">NANDSimpleSafeClose</a></CODE>.
36<li>Delete the file.
37</ol>
38</p>
39<p>
40If the <code>NAND_RESULT_AUTHENTICATION</code> or <code>NAND_RESULT_ECC_CRIT</code> error is returned during step 2 or 3, this sample program includes the process code to call the <CODE><a href="../NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a></CODE> function and to recover from the error. See <a href="../sequence.html">Processing Sequence</a>.
41</p>
42
43<H2>See Also</H2>
44<p>
45<CODE><a href="../NANDSimpleSafeCancel.html">NANDSimpleSafeCancel</a></CODE>, <CODE><a href="../NANDSimpleSafeCancelAsync.html">NANDSimpleSafeCancelAsync</a></CODE>, <CODE><a href="../NANDSimpleSafeOpen.html">NANDSimpleSafeOpen</a></CODE>, <CODE><a href="../NANDSimpleSafeOpenAsync.html">NANDSimpleSafeOpenAsync</a></CODE>, <CODE><a href="../NANDSimpleSafeClose.html">NANDSimpleSafeClose</a></CODE>, <CODE><a href="../NANDSimpleSafeCloseAsync.html">NANDSimpleSafeCloseAsync</a></CODE>, <CODE><a href="../sequence.html">Processing Sequence</a></CODE>
46</p>
47
48<H2>Revision History</H2>
49<p>
502007/05/09 Initial version. <BR>
51</p>
52
53<hr><p>CONFIDENTIAL</p></body>
54</HTML>
55