|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-05-12 13:54:02
Beman Dawes wrote:
> status_flag status_imp( const char * path, system_error_type * ec )
> {
> struct stat path_stat;
>
> if ( ::stat( path, &path_stat ) != 0 )
> {
> if ( ec != 0 ) *ec = errno;
> return ((errno == ENOENT) || (errno == ENOTDIR))
> ? fs::not_found_flag : fs::error_flag;
> }
>
> system_error_type result(0);
status_flag result( 0 );
>
> if ( S_ISDIR( path_stat.st_mode ) ) result |= fs::directory_flag;
> if ( S_ISREG( path_stat.st_mode ) ) result |= fs::file_flag;
>
> return result;
> }
This makes perfect sense; what changes did you expect from me? :-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk