source: rtems/cpukit/libmisc/shell/cat_file.c @ 7eada71

4.115
Last change on this file since 7eada71 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 622 bytes
Line 
1/*
2 *  CAT Command Implementation
3 *
4 *  Author:
5 *   WORK: fernando.ruiz@ctv.es
6 *   HOME: correo@fernando-ruiz.com
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <stdio.h>
18#include <rtems/shell.h>
19
20int rtems_shell_cat_file(FILE * out,const char * name) {
21  FILE * fd;
22  int c;
23
24  if (out) {
25    fd = fopen(name,"r");
26    if (!fd) {
27      return -1;
28    }
29    while ((c=fgetc(fd))!=EOF)
30      fputc(c,out);
31    fclose(fd);
32  }
33  return 0;
34}
35
36
Note: See TracBrowser for help on using the repository browser.