12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /*
- * Copyright (c) 2011-2012 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- * Program for testing stat function call on filesystem
- */
- #include <fcntl.h>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <errno.h>
- #include <string.h>
- #include <stdio.h>
- #define EOK 0
- #define ENOPATH 1
- int main(int argc, char *argv[])
- {
- struct stat stb;
- int statres;
- if (argc > 1)
- {
- access(argv[1], R_OK);
- statres = stat(argv[1], &stb);
- }
- else
- {
- fprintf(stderr,"Not enough args\n");
- }
- return statres;
- }
|