Diff
Not logged in

Differences From Artifact [b43e89c4bf]:

To Artifact [cf0cd7a9c9]:


195
196
197
198
199
200
201















202
203
204
205
206
207
208
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







#  endif
  return ((S_IXUSR)&fileStat.st_mode)!=0;
#else
  return ((S_IXUSR|S_IXGRP|S_IXOTH)&fileStat.st_mode)!=0;
#endif
}


/*
** Return file "permissions":
** 0: normal
** 1: exec
** 2: symlink
*/
int file_perm(const char *zFilename){
  //TODO(dchest): optimize by calling stat once.
  if( file_isexe(zFilename) )
    return 1;
  if( file_islink(zFilename) )
    return 2;
  return 0;
}

/*
** Return 1 if zFilename is a directory.  Return 0 if zFilename
** does not exist.  Return 2 if zFilename exists but is something
** other than a directory.
*/
int file_isdir(const char *zFilename){