1,10 → 1,38 |
/* |
* Copyright (c) 2007 Konopa-Jelen-Majer |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
|
/** @addtogroup FSDemo |
* @{ |
*/ |
|
/** |
* @file cat.c |
* @brief A file system demonstration task |
* @file cat.standard.c |
* @brief A file system demonstration task - standard library version |
*/ |
|
|
18,6 → 46,10 |
#include <io/file.h> |
#include <io/stat.h> |
|
|
/** |
* This is a very basic linear demonstration script of the standard file library |
*/ |
int main(int argc, char *argv[]) |
{ |
|
30,7 → 62,7 |
printf("Cat task\n"); |
|
/* File list in working directory. */ |
/* printf("File list:\n"); |
printf("File list:\n"); |
dir_items = ls(&dir_items_length); |
printf("Got a list\n"); |
|
40,12 → 72,12 |
printf("File name: %s\n", dir_items[entry].name); |
|
} |
*/ |
|
/* We want to change working directory */ |
retval = chdir("uspace/fs"); |
|
/* We want to work with specified file. */ |
/* file = fopen("fs.c", F_MODE_READ); |
file = fopen("fs.c", F_MODE_READ); |
retval = fstat( file ); |
|
printf("Info about file: %s\n", file->base_info.name); |
71,11 → 103,10 |
printf("\nContent of the buffer:\n"); |
printf(buffer); |
printf("\n\n"); |
*/ |
/* close the file */ |
// retval = fclose( file ); |
/*close the file */ |
retval = fclose( file ); |
|
// return 0; |
return 0; |
} |
|
/** |