[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [MiNT] Longfilename support functions?



> From: owner-mint@fishpool.com [mailto:owner-mint@fishpool.com]On Behalf
> Of Stanislav Opichal
> Sent: Wednesday, June 07, 2000 3:48 PM
> To: MiNT list
> Subject: Re: [MiNT] Longfilename support functions?
>
>
> Hi!
>
> > > BTW: Under MagiCCP it seems not to set the index properly as mentioned
> > > before.
> > > The files are beeing loaded multiple times here...
> >
> > Setting it to 0 won't hurt, but it won't help with MiNT + TOSDS either
> > (where Fxattr() just returns an incrementing counter as index).
>
> I see... so should the function be as follows?
>
> GetFile( char *filename )
> {
>     if ( ! Dpathconf( filename, DP_CASE ) ) {
>         XATTR xattr;
>         res = Fxattr( 0, filename, &xattr );
>     } else {
>         xattr.dev = 0;
>         xattr.index = 0;
>         res = 0;
>     }
>
>     if (( res == 0 || ( res == EINVFN )) {
>         /* store the index, dev and pathname*/
>     } else {
>         /* an error occured */
>     }
> }
>
> Will this work?

If you really want to use the index, the proper way is to check whether the
filesystem reports indices correctly. There is a specific DPathconf opcode
for this (not DP_CASE).