Changeset 8639
- Timestamp:
- 11/29/10 17:26:00 (2 years ago)
- Location:
- branches/windows-client
- Files:
-
- 2 added
- 2 modified
-
projects/OrangeFS/OrangeFS.sln (modified) (2 diffs)
-
projects/OrangeFS/pvfs2-ls (added)
-
projects/OrangeFS/pvfs2-ls/pvfs2-ls.vcxproj (added)
-
src/apps/admin/pvfs2-ls.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/windows-client/projects/OrangeFS/OrangeFS.sln
r8635 r8639 115 115 EndProject 116 116 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proto", "proto\proto.vcxproj", "{2F406AB6-D010-4196-A523-FAE6F2B1585F}" 117 EndProject 118 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pvfs2-ls", "pvfs2-ls\pvfs2-ls.vcxproj", "{09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}" 117 119 EndProject 118 120 Global … … 272 274 {2F406AB6-D010-4196-A523-FAE6F2B1585F}.Release|x64.ActiveCfg = Release|x64 273 275 {2F406AB6-D010-4196-A523-FAE6F2B1585F}.Release|x64.Build.0 = Release|x64 276 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Debug|Win32.ActiveCfg = Debug|Win32 277 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Debug|Win32.Build.0 = Debug|Win32 278 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Debug|x64.ActiveCfg = Debug|Win32 279 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Release|Win32.ActiveCfg = Release|Win32 280 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Release|Win32.Build.0 = Release|Win32 281 {09F8C9E4-1E99-4EBB-88E6-2A2CA290D718}.Release|x64.ActiveCfg = Release|Win32 274 282 EndGlobalSection 275 283 GlobalSection(SolutionProperties) = preSolution -
branches/windows-client/src/apps/admin/pvfs2-ls.c
r8638 r8639 20 20 #endif 21 21 #include <assert.h> 22 #ifndef WIN32 22 23 #include <getopt.h> 24 #endif 23 25 24 26 #include "pvfs2.h" … … 224 226 char *formatted_size = NULL; 225 227 char *formatted_owner = NULL, *formatted_group = NULL, *formatted_time = NULL; 228 #ifdef WIN32 229 230 #else 226 231 struct group *grp = NULL; 227 232 struct passwd *pwd = NULL; 233 #endif 228 234 char *empty_str = ""; 229 235 char *owner = empty_str, *group = empty_str; … … 321 327 if (!opts->list_no_owner) 322 328 { 329 #ifdef WIN32 330 owner = scratch_owner; 331 #else 323 332 pwd = getpwuid((uid_t)attr->owner); 324 333 owner = (pwd ? pwd->pw_name : scratch_owner); 334 #endif 325 335 } 326 336 327 337 if (!opts->list_no_group) 328 338 { 339 #ifdef WIN32 340 group = scratch_group; 341 #else 329 342 grp = getgrgid((gid_t)attr->group); 330 343 group = (grp ? grp->gr_name : scratch_group); 344 #endif 345 331 346 } 332 347 } … … 610 625 for(i = 0; i < rdplus_response.pvfs_dirent_outcount; i++) 611 626 { 627 PVFS_sys_attr *attr; 628 612 629 cur_file = rdplus_response.dirent_array[i].d_name; 613 630 cur_handle = rdplus_response.dirent_array[i].handle; … … 618 635 opts, entry_buffer); 619 636 620 PVFS_sys_attr *attr = &rdplus_response.attr_array[i];637 attr = &rdplus_response.attr_array[i]; 621 638 if(attr->objtype == PVFS_TYPE_DIRECTORY && opts->list_recursive) 622 639 { … … 713 730 * returns pointer to options structure on success, NULL on failure 714 731 */ 732 #ifdef WIN32 715 733 static struct options* parse_args(int argc, char* argv[]) 716 734 { … … 718 736 const char *cur_option = NULL; 719 737 struct options* tmp_opts = NULL; 738 739 static char str_opts[14][16] = { 740 "help", 741 "human-readable", 742 "si", 743 "version", 744 "recursive", 745 "verbose", 746 "numeric-uid-gid", 747 "directory", 748 "no-group", 749 "almost-all", 750 "all", 751 "inode", 752 "size", 753 "all-times" 754 }; 755 756 tmp_opts = (struct options*)malloc(sizeof(struct options)); 757 if (!tmp_opts) 758 { 759 return(NULL); 760 } 761 memset(tmp_opts, 0, sizeof(struct options)); 762 /* RVndGoAaiglt */ 763 option_index = 1; 764 while ((option_index < argc) && (argv[option_index][0] == '-')) 765 { 766 cur_option = argv[option_index]; 767 768 if ((strcmp(cur_option, "-?") == 0) || 769 (strcmp(cur_option, "--help") == 0)) 770 { 771 usage(argc, argv); 772 exit(0); 773 } 774 else if ((strcmp(cur_option, "--human-readable") == 0) || 775 (strcmp(cur_option, "-h") == 0)) 776 { 777 tmp_opts->list_human_readable = 1; 778 } 779 else if (strcmp(cur_option, "--si") == 0) 780 { 781 tmp_opts->list_use_si_units = 1; 782 break; 783 } 784 else if (strcmp(cur_option, "--version") == 0) 785 { 786 printf("%s\n", PVFS2_VERSION); 787 exit(0); 788 } 789 else if ((strcmp(cur_option, "--recursive") == 0) || 790 (strcmp(cur_option, "-R") == 0)) 791 { 792 tmp_opts->list_recursive = 1; 793 } 794 else if ((strcmp(cur_option, "--verbose") == 0) || 795 (strcmp(cur_option, "-V") == 0)) 796 { 797 tmp_opts->list_verbose = 1; 798 } 799 else if ((strcmp(cur_option, "--numeric-uid-gid") == 0) || 800 (strcmp(cur_option, "-n") == 0)) 801 { 802 tmp_opts->list_long = 1; 803 tmp_opts->list_numeric_uid_gid = 1; 804 } 805 else if ((strcmp(cur_option, "--directory") == 0) || 806 (strcmp(cur_option, "-d") == 0)) 807 { 808 tmp_opts->list_directory = 1; 809 } 810 else if ((strcmp(cur_option, "--no-group") == 0) || 811 (strcmp(cur_option, "-G") == 0)) 812 { 813 tmp_opts->list_long = 1; 814 tmp_opts->list_no_group = 1; 815 } 816 else if ((strcmp(cur_option, "--almost-all") == 0) || 817 (strcmp(cur_option, "-A") == 0)) 818 { 819 tmp_opts->list_almost_all = 1; 820 } 821 else if ((strcmp(cur_option, "--all") == 0) || 822 (strcmp(cur_option, "-a") == 0)) 823 { 824 tmp_opts->list_all = 1; 825 } 826 else if ((strcmp(cur_option, "--inode") == 0) || 827 (strcmp(cur_option, "-i") == 0)) 828 { 829 tmp_opts->list_inode = 1; 830 } 831 else if ((strcmp(cur_option, "--all-times") == 0)) 832 { 833 tmp_opts->list_all_times = 1; 834 } 835 else if (strcmp(cur_option, "-l") == 0) 836 { 837 tmp_opts->list_long = 1; 838 } 839 else 840 { 841 usage(argc, argv); 842 exit(EXIT_FAILURE); 843 } 844 845 option_index++; 846 } 847 848 for(i = option_index; i < argc; i++) 849 { 850 if (tmp_opts->num_starts < MAX_NUM_PATHS) 851 { 852 tmp_opts->start[i-option_index] = argv[i]; 853 tmp_opts->num_starts++; 854 } 855 else 856 { 857 fprintf(stderr,"Ignoring path %s\n",argv[i]); 858 } 859 } 860 861 return tmp_opts; 862 863 } 864 #else 865 static struct options* parse_args(int argc, char* argv[]) 866 { 867 int i = 0, ret = 0, option_index = 0; 868 const char *cur_option = NULL; 869 struct options* tmp_opts = NULL; 870 720 871 static struct option long_opts[] = 721 872 { … … 884 1035 return tmp_opts; 885 1036 } 1037 #endif 886 1038 887 1039 static void usage(int argc, char** argv)
