00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* TODO: Test all functions */ 00018 00019 #include "mysys_priv.h" 00020 #include "my_dir.h" 00021 00022 int main(int argc, char *argv[]) 00023 { 00024 MY_DIR *a; 00025 uint f; 00026 DBUG_ENTER ("main"); 00027 DBUG_PROCESS (argv[0]); 00028 00029 if (--argc > 0 && (*(++argv))[0] == '-' && (*argv)[1] == '#' ) 00030 DBUG_PUSH (*argv+2); 00031 00032 a = my_dir("./", 0); 00033 for (f = 0; f < a->number_off_files; f++) 00034 { 00035 printf("%s\n", a->dir_entry[f].name); 00036 } 00037 00038 a = my_dir("./", MY_WANT_STAT); 00039 for (f = 0; f < a->number_off_files; f++) 00040 { 00041 printf("%s %d %d %d %s\n", a->dir_entry[f].name, 00042 (int) a->dir_entry[f].mystat.st_size, 00043 (int) a->dir_entry[f].mystat.st_uid, 00044 (int) a->dir_entry[f].mystat.st_gid, 00045 S_ISDIR(a->dir_entry[f].mystat.st_mode) ? "dir" : ""); 00046 } 00047 return 0; 00048 }
1.4.7

