Changeset 337 in PSPA
- Timestamp:
- Feb 20, 2013, 2:58:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_serverFileSelector.cc
r336 r337 35 35 36 36 /* read the directory's contents, print out the name of each entry. */ 37 printf("Directory contents:\n");38 37 DIR* dir = opendir(workingDir_.c_str()); 39 38 if (!dir) { 40 perror("opendir");41 39 exit(1); 42 40 } … … 45 43 /* check if the given entry is a directory. */ 46 44 if (stat(entry->d_name, &dir_stat) == -1) { 47 perror("stat:");48 printf("stat:%s\n",entry->d_name);49 45 continue; 50 } else {51 printf("false%s\n", entry->d_name);52 46 } 53 47 } … … 110 104 /* first, save path of current working directory */ 111 105 if (!getcwd(cwd, MAX_DIR_PATH+1)) { 112 perror("getcwd:");113 106 return; 114 107 } … … 118 111 dir = opendir(folder); 119 112 if (!dir) { 120 fprintf(stderr, "Cannot read directory '%s': ", cwd);121 perror("");122 113 return; 123 114 } … … 136 127 /* check if the given entry is a directory. */ 137 128 if (entry->d_type == DT_DIR) { 138 printf("++DIR %s\n",entry->d_name);139 129 Wt::WIconPair *folderIcon = new Wt::WIconPair("htdocs/yellow-folder-closed.png", 140 130 "htdocs/yellow-folder-open.png", false); … … 144 134 145 135 } else { 146 printf("++FILE %s\n",entry->d_name);147 136 148 137 /* check if the pattern matchs. */ 149 138 if (boost::algorithm::ends_with(entry->d_name, pattern)) { 150 139 treeFileRoot->addChildNode(new Wt::WTreeNode(entry->d_name)); 151 printf("-----%s/%s\n", cwd, entry->d_name);152 140 } 153 141 }
Note: See TracChangeset
for help on using the changeset viewer.