Changeset 3291

Show
Ignore:
Timestamp:
04/02/07 09:58:47 (6 years ago)
Author:
balister
Message:

FileSystem::list passes JTAP.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossie/branches/philip-work/framework/FileSystem_impl.cpp

    r3288 r3291  
    150150            DEBUG(9, FileSystem, "In list checking file " << itr->leaf()); 
    151151 
    152             if (fnmatch(searchPattern.c_str(), itr->leaf().c_str(), 0)) { 
     152            if (fnmatch(searchPattern.c_str(), itr->leaf().c_str(), 0) == 0) { 
    153153                DEBUG(9, FileSystem, "Match in list with " << itr->leaf()); 
    154154 
    155155                result->length(idx + 1); 
    156                 fs::path foundPath(filePath.branch_path() / itr->leaf()); 
    157                 result[idx].name = CORBA::string_dup(foundPath.string().c_str()); 
    158                 if (fs::is_directory(*itr)) 
     156                if (fs::is_directory(*itr)) { 
     157                    std::string tmp(itr->leaf()); 
     158                    tmp += "/"; 
     159                    result[idx].name = CORBA::string_dup(tmp.c_str()); 
    159160                    result[idx].kind = CF::FileSystem::DIRECTORY; 
    160                 else 
     161                    result[idx].size = 0; 
     162                } else { 
     163                    result[idx].name = CORBA::string_dup(itr->leaf().c_str()); 
    161164                    result[idx].kind = CF::FileSystem::PLAIN; 
    162                  
    163                 result[idx].size = fs::file_size(*itr); 
     165                    result[idx].size = fs::file_size(*itr); 
     166                } 
     167 
    164168                 
    165169                /// \todo fix file creation time and last access time