michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /*********************************************************************** michael@0: ** michael@0: ** Name: op_filok.c michael@0: ** michael@0: ** Description: Test Program to verify the PR_Open finding an existing file. michael@0: ** michael@0: ** Modification History: michael@0: ** 03-June-97 AGarcia- Initial version michael@0: ***********************************************************************/ michael@0: michael@0: /*********************************************************************** michael@0: ** Includes michael@0: ***********************************************************************/ michael@0: /* Used to get the command line option */ michael@0: #include "prinit.h" michael@0: #include "prmem.h" michael@0: #include "prio.h" michael@0: #include "prerror.h" michael@0: #include michael@0: michael@0: static PRFileDesc *t1; michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: PR_STDIO_INIT(); michael@0: michael@0: t1 = PR_Open(argv[0], PR_RDONLY, 0666); michael@0: michael@0: if (t1 == NULL) { michael@0: printf ("error code is %d \n", PR_GetError()); michael@0: printf ("File %s should be found\n", argv[0]); michael@0: return 1; michael@0: } else { michael@0: if (PR_Close(t1) == PR_SUCCESS) { michael@0: printf ("Test passed \n"); michael@0: return 0; michael@0: } else { michael@0: printf ("cannot close file\n"); michael@0: printf ("error code is %d\n", PR_GetError()); michael@0: return 1; michael@0: } michael@0: } michael@0: }