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>NANDSetStatus</title> 9</head> 10 11<body> 12 13<h1>NANDSetStatus</h1> 14 15<h2>Syntax</h2> 16<dl><dd><pre class="construction">#include <revolution/nand.h> 17 18s32 NANDSetStatus( const char *path, const NANDStatus *stat ); 19</pre></dd></dl> 20 21<h2>Arguments</h2> 22<p> 23<TABLE class="arguments" border="1" > 24 <tr> 25<TH><code><EM><STRONG>path</STRONG></EM></code></TH> 26<TD>Specifies the path of the target file or directory.</TD> 27 </tr> 28 <tr> 29<TH><STRONG><EM><CODE>stat</CODE></EM></STRONG></TH> 30<TD>Pointer to a <CODE>NANDStatus</CODE> structure.</TD> 31 </tr> 32</TABLE> 33</p> 34 35<h2>Return Values</h2> 36<p> 37Returns one of the following codes. 38<p> 39<code> 40NAND_RESULT_OK<br> 41NAND_RESULT_ACCESS<br> 42NAND_RESULT_ALLOC_FAILED<br> 43NAND_RESULT_BUSY<br> 44NAND_RESULT_CORRUPT<br> 45NAND_RESULT_INVALID<br> 46NAND_RESULT_NOEXISTS<br> 47<S>NAND_RESULT_NOTEMPTY</S><br> 48NAND_RESULT_UNKNOWN<br> 49NAND_RESULT_FATAL_ERROR<br> 50</code> 51</p> 52</p> 53 54<H2>Description</H2> 55<p> 56Sets the status of the specified file or directory. This operation cannot be performed if the file or directory has an owner ID that is different from the owner ID of the application. <S>If this operation is performed on a file, the file size must be zero.</S></S> Permission can be specified with the <CODE>permission</CODE> member variable of the <CODE>NANDStatus</CODE> structure. <font color="#ff0000">However, at the very least the <CODE>NAND_PERM_OWNER_READ</CODE> permission must be granted. </font> If the <CODE>NAND_PERM_OWNER_READ</CODE> permission is not granted, the function will return <CODE>NAND_RESULT_INVALID</CODE>. 57</p> 58 59<p> 60If this function is used on the home directory, the permissions will be initialized by the system when the application restarts. In order to avoid problems caused by the initialization of permissions, do not use this function on the home directory. 61</p> 62 63<p> 64This 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>. 65</p> 66 67<h2>See Also</h2> 68<p class="reference"> 69<a href="./NANDStatus.html">NANDStatus</a>, 70<a href="./NANDGetStatus.html">NANDGetStatus</a>, 71<a href="./NANDGetStatusAsync.html">NANDGetStatusAsync</a>, 72<a href="./NANDSetStatusAsync.html">NANDSetStatusAsync</a>, 73<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a> 74</p> 75 76<H2>Revision History</H2> 77<p> 782007/12/10 Added a mention of the fact that the permissions for the home directory will be initialized by the system upon restarting.<br>2007/09/25 Added information about the sleep status of threads.<br>2006/11/30 Added the <CODE>NAND_RESULT_ALLOC_FAILED</CODE> and <CODE>NAND_RESULT_BUSY</CODE> codes.<br>2006/11/13 Added an explanation about the need to grant <CODE>NAND_PERM_OWNER_READ</CODE> permission.<br>2006/11/13 Deleted the section about restrictions on file size.<br>2006/06/16 Initial version.<BR> 79</p> 80 81<hr><p>CONFIDENTIAL</p></body> 82</html>