Example #1
0
   void __dos_finddata_cvt( struct find_t *findbuf, struct _finddata_t *fileinfo )
  #endif
 #endif
/******************************************************************************/
{
    /*** Handle attributes ***/
    fileinfo->attrib = findbuf->attrib;

    /*** Handle the timestamps ***/
  #ifdef __WATCOM_LFN__
    if( IS_LFN( findbuf ) && CRTIME_OF( findbuf ) ) {
        fileinfo->time_create = _d2ttime( CRDATE_OF( findbuf ), CRTIME_OF( findbuf ) );
        fileinfo->time_access = _d2ttime( ACDATE_OF( findbuf ), ACTIME_OF( findbuf ) );
    } else {
  #endif
        fileinfo->time_create = -1L;
        fileinfo->time_access = -1L;
  #ifdef __WATCOM_LFN__
    }
  #endif
    fileinfo->time_write = _d2ttime( findbuf->wr_date, findbuf->wr_time );
    /*** Handle the file size ***/
  #ifdef __INT64__
    U64Set( (unsigned_64 *)&fileinfo->size, findbuf->size, 0 );
  #else
    fileinfo->size = findbuf->size;
  #endif

    /*** Handle the file name ***/
    __F_NAME(strcpy,wcscpy)( fileinfo->name, findbuf->name );
}
Example #2
0
_WCRTLINK unsigned _dos_findclose( struct find_t *fdta )
/******************************************************/
{
#if defined( __WATCOM_LFN__ )
    tiny_ret_t      rc;

    if( IS_LFN( fdta ) ) {
        if( TINY_OK( rc = _dos_find_close_lfn( LFN_HANDLE_OF( fdta ) ) ) )
            return( 0 );
        return( __set_errno_dos_reterr( TINY_INFO( rc ) ) );
    }
#endif
#ifdef __OSI__
    return( __dos_find_close_dta( fdta ) );
#else
    return( 0 );
#endif
}
Example #3
0
_WCRTLINK unsigned _dos_findnext( struct find_t *fdta )
/*****************************************************/
{
#ifdef __WATCOM_LFN__
    lfnfind_t       lfndta;
    tiny_ret_t      rc;

    if( IS_LFN( fdta ) ) {
        rc = _dos_find_next_lfn( LFN_HANDLE_OF( fdta ), &lfndta );
        if( TINY_OK( rc ) ) {
            convert_to_find_t( fdta, &lfndta );
            return( 0 );
        }
        return( __set_errno_dos_reterr( TINY_INFO( rc ) ) );
    }
#endif
    return( __dos_find_next_dta( fdta ) );
}