Boost logo

Boost Users :

From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2006-07-13 05:04:38


Hi!

On my Windows computer I have cygwin installed and it created the following file names in
directory c:\

%backup%~
.emacs
.emacs~
.tcltcinfo.txt

The last file was created by some cygwin app.

Now if I try to iterate through this directory:

for(fs::directory_iterator dir_itr( full_path ), end_iter; dir_itr != end_iter; ++dir_itr)
{
        try
        {
                if(!fs::is_directory(*dir_itr))
                {
                        std::pair<std::string, std::string> file_name( fs::basename(dir_itr->leaf()),
fs::extension(dir_itr->leaf()) );
                        std::cout << "fname: " << file_name.first << ", extension: " << file_name.second << std::endl;
                }
        }
        catch(std::exception const& ex )
        {
                std::cout << dir_itr->leaf() << " " << ex.what() << std::endl;
        }
}

Exceptions are thrown:

%backup%~ boost::filesystem::path: invalid name "%backup%~" in path: "%backup%~"
.emacs boost::filesystem::path: invalid name ".emacs" in path: ".emacs"
.emacs~ boost::filesystem::path: invalid name ".emacs~" in path: ".emacs~"
.tcltcinfo.txt boost::filesystem::path: invalid name ".tcltcinfo.txt" in path: ".tcltcinfo.txt"

I know that it is impossible to create these file manually, but software is allowed to do this.
Therefore I don't think these exceptions are correct.

With Kind Regards,

Ovanes Markarian


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net