Implement redirection of output from NSH builtin commands to a file in a mounted volume

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5521 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-15 21:01:37 +00:00
parent 90a72e97d3
commit fcb316906d
16 changed files with 1018 additions and 693 deletions
+10 -9
View File
@@ -1314,15 +1314,16 @@ static int fat_dup(FAR const struct file *oldp, FAR struct file *newp)
* file is re-opened.
*/
newff->ff_bflags = 0;
newff->ff_oflags = oldff->ff_oflags;
newff->ff_sectorsincluster = oldff->ff_sectorsincluster;
newff->ff_dirindex = oldff->ff_dirindex;
newff->ff_currentcluster = oldff->ff_currentcluster;
newff->ff_dirsector = oldff->ff_dirsector;
newff->ff_size = oldff->ff_size;
newff->ff_currentsector = 0;
newff->ff_cachesector = 0;
newff->ff_bflags = 0; /* File buffer flags */
newff->ff_oflags = oldff->ff_oflags; /* File open flags */
newff->ff_sectorsincluster = oldff->ff_sectorsincluster; /* Sectors remaining in cluster */
newff->ff_dirindex = oldff->ff_dirindex; /* Index to directory entry */
newff->ff_currentcluster = oldff->ff_currentcluster; /* Current cluster */
newff->ff_dirsector = oldff->ff_dirsector; /* Sector containing directory entry */
newff->ff_size = oldff->ff_size; /* Size of the file */
newff->ff_startcluster = oldff->ff_startcluster; /* Start cluster of file on media */
newff->ff_currentsector = oldff->ff_currentsector; /* Current sector */
newff->ff_cachesector = 0; /* Sector in file buffer */
/* Attach the private date to the struct file instance */