2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
12 /*****************************************************************************
20 const char * pathname
,
24 Opens a file with the specified name in the specified mode.
27 pathname - Path and filename of the file you want to open.
28 mode - How to open the file:
30 r: Open for reading. The stream is positioned at the
31 beginning of the file.
33 r+: Open for reading and writing. The stream is positioned
34 at the beginning of the file.
36 w: Open for writing. If the file doesn't exist, then
37 it is created. If it does already exist, then
38 it is truncated. The stream is positioned at the
39 beginning of the file.
41 w+: Open for reading and writing. If the file doesn't
42 exist, then it is created. If it does already
43 exist, then it is truncated. The stream is
44 positioned at the beginning of the file.
46 a: Open for writing. If the file doesn't exist, then
47 it is created. The stream is positioned at the
50 a+: Open for reading and writing. If the file doesn't
51 exist, then it is created. The stream is positioned
52 at the end of the file.
54 b: Open in binary more. This has no effect and is ignored.
57 A pointer to a FILE handle or NULL in case of an error. When NULL
58 is returned, then errno is set to indicate the error.
61 This function must not be used in a shared library or
62 in a threaded application.
67 Most modes are not supported right now.
70 fclose(), fread(), fwrite(), open(), fgets(), fgetc(),
71 fputs(), fputc(), getc(), putc()
75 ******************************************************************************/
78 int openmode
= __smode2oflags(mode
);
82 fd
= open(pathname
, openmode
, 644);
86 return fdopen(fd
, NULL
);