00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #if defined (LINUX) || defined (SUN)
00014
00015 #include "fileops.h"
00016 #include <sys/types.h>
00017 #include <sys/stat.h>
00018
00019 int
00020 rcs_fileop_isfile (const char *path)
00021 {
00022 struct stat buf;
00023
00024
00025 if (stat (path, &buf) < 0)
00026 {
00027 return 0;
00028 }
00029
00030 if (S_ISREG (buf.st_mode))
00031 {
00032 return 1;
00033 }
00034
00035 return 0;
00036 }
00037
00038 int
00039 rcs_fileop_isdir (const char *path)
00040 {
00041 struct stat buf;
00042
00043
00044 if (stat (path, &buf) < 0)
00045 {
00046 return 0;
00047 }
00048
00049 if (S_ISDIR (buf.st_mode))
00050 {
00051 return 1;
00052 }
00053
00054 return 0;
00055 }
00056
00057 int
00058 rcs_fileop_islink (const char *path)
00059 {
00060 struct stat buf;
00061
00062
00063 if (lstat (path, &buf) < 0)
00064 {
00065 return 0;
00066 }
00067
00068 if (S_ISLNK (buf.st_mode))
00069 {
00070 return 1;
00071 }
00072
00073 return 0;
00074 }
00075
00076 #endif
00077
00078
00079 #if defined (WIN32)
00080
00081 #include "fileops.h"
00082
00083
00084
00085 int
00086 rcs_fileop_isfile (const char *path)
00087 {
00088 return 1;
00089 }
00090
00091 int
00092 rcs_fileop_isdir (const char *path)
00093 {
00094 return 0;
00095 }
00096
00097 int
00098 rcs_fileop_islink (const char *path)
00099 {
00100 return 0;
00101 }
00102
00103 #endif