139
139
if (MyFlags & MY_WANT_STAT)
141
if (!(finfo.mystat= (MY_STAT*)alloc_root(names_storage,
141
if (!(finfo.mystat= (struct stat*)alloc_root(names_storage,
142
sizeof(struct stat))))
145
bzero(finfo.mystat, sizeof(MY_STAT));
145
bzero(finfo.mystat, sizeof(struct stat));
146
146
VOID(strmov(tmp_file,dp->d_name));
147
VOID(my_stat(tmp_path, finfo.mystat, MyFlags));
147
VOID(stat(tmp_path, finfo.mystat));
148
148
if (!(finfo.mystat->st_mode & MY_S_IREAD))
209
209
} /* directory_file_name */
212
/****************************************************************************
214
** Note that MY_STAT is assumed to be same as struct stat
215
****************************************************************************/
217
int my_fstat(int Filedes, MY_STAT *stat_area,
218
myf MyFlags __attribute__((unused)))
220
DBUG_ENTER("my_fstat");
221
DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
222
DBUG_RETURN(fstat(Filedes, (struct stat *) stat_area));
226
MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
229
DBUG_ENTER("my_stat");
230
DBUG_PRINT("my", ("path: '%s' stat_area: 0x%lx MyFlags: %d", path,
231
(long) stat_area, my_flags));
233
if ((m_used= (stat_area == NULL)))
234
if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
236
if (! stat((char *) path, (struct stat *) stat_area) )
237
DBUG_RETURN(stat_area);
239
DBUG_PRINT("error",("Got errno: %d from stat", errno));
241
if (m_used) /* Free if new area */
242
my_free((uchar*) stat_area,MYF(0));
245
if (my_flags & (MY_FAE+MY_WME))
247
my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),path,my_errno);
248
DBUG_RETURN((MY_STAT *) NULL);
250
DBUG_RETURN((MY_STAT *) NULL);