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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>CARDWrite</title>
10</head>
11
12<body>
13
14<h1>CARDWrite</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/card.h&gt;</CODE></pre></dd>
21<dd><pre>s32 CARDWrite(CARDFileInfo* fileInfo, const void* buf, s32 length, s32 offset);
22</CODE></pre></dd>
23</dl><h2>Arguments</h2>
24<TABLE border="1" cellpadding="3" cellspacing="0.1">
25  <tr>
26<TD width="120" bgcolor="#ffffe8"><em><strong><code>fileInfo</code></strong></em></TD>
27<TD width="520">Pointer to the file info of the file to write. <code><em><strong>fileInfo</strong></em></code> must be valid file information that was initialized using the <code><a href="CARDOpen.html">CARD</a><a href="CARDFastOpen.html">[Fast]</a><a href="CARDOpen.html">Open</a></code> or <code><a href="CARDCreate.html">CARDCreate</a><a href="CARDCreateAsync.html">[Async]</a></code> function.</TD>
28    </tr>
29  <tr>
30<TD width="120" bgcolor="#ffffe8"><em><strong><code>buf</code></strong></em></TD>
31<TD width="520">Buffer address (32-byte alignment).</TD>
32    </tr>
33  <tr>
34<TD width="120" bgcolor="#ffffe8"><em><strong><code>length</code></strong></em></TD>
35<TD width="520">Number of bytes to write. The length must be a multiple of the card sector size returned by <code><a href="CARDGetSectorSize.html">CARDGetSectorSize</a></code>.</TD>
36    </tr>
37  <tr>
38<TD width="120" bgcolor="#ffffe8"><em><strong><code>offset</code></strong></em></TD>
39<TD width="520">The position of the file to start write. The offset must be a multiple of the card sector size returned by <code><a href="CARDGetSectorSize.html">CARDGetSectorSize</a></code>.</TD>
40    </tr>
41</TABLE>
42<h2>Return Values</h2>
43
44<p>One of the following codes:</p>
45
46<p><code>CARD_RESULT_FATAL_ERROR<br> CARD_RESULT_NOCARD<br> CARD_RESULT_BUSY<br> CARD_RESULT_NOFILE<br> CARD_RESULT_NOPERM<br> CARD_RESULT_IOERROR<br> CARD_RESULT_LIMIT<br> CARD_RESULT_CANCELED<br> CARD_RESULT_READY</code></p>
47<H2>Description</H2>
48<P>Writes data to a file synchronously.</P>
49<p>
50This function may put the current thread to sleep. For precautions when calling similar functions, refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.
51</p>
52<P><STRONG><B>Note:</B></STRONG> This function is provided for debugging purposes. Applications should not use this function.</P>
53<h2>See Also</h2>
54<P>
55<code><a href="CARDOpen.html">CARD</a><a href="CARDFastOpen.html">[Fast]</a><a href="CARDOpen.html">Open</a></code><br> <code><a href="CARDCreate.html">CARDCreate</a><a href="CARDCreateAsync.html">[Async]</a></code><br> <code><a href="CARDCancel.html">CARDCancel()</a></code><br> <code><a href="CARDGetResultCode.html">CARDGetResultCode()</a></code><br> <a href="CARDGetSectorSize.html"><code>CARDGetSectorSize()</code></a>
56</P>
57<H2>Revision History</H2>
58<P>2007/09/25 Added information on the sleep status of threads.<br>2006/03/01 Initial version.</P>
59<hr><p>CONFIDENTIAL</p></body>
60</html>
61