[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:00 PM
> To: MiNT list
> Subject: Re: [MiNT] Longfilename support functions?
>
>
> > > > > You could use Fxattr() (with "follow links" flag on) on the
> > > file. If dev
> > > > > and index are identical to an already opened group's file,
> > > don't open it
> > > > > again. This will not only work for different cases in filenames on
> > > > > filesystems not regarding case, but also for symbolic links.
> > >
> > > Will this work with filesystems like TOS/VFAT (and both on MiNT and
> Magic)
> > > that don't record a file index?
> >
> > This will not work for filesystems where Fxattr exists, but the
> file index
> > is not filled properly. AFAIK, only TOSFS under MiNT would be affected
> > (maybe WINDOWS-FS under MagiCPC as well).
>
> So, again, how should I do a "unique" file detection running in any OS and
> on any FS???
> I've already modified the sources to use the following (pseudocode used
> here):
>
> BOOLEAN FileNameComparison( MyFileStruct *f1, MyFileStruct *f2 ) {
>     if ( f1->index == f2->index )
>         if ( f1->dev == f2->dev )
>             return ( ! stricmp( f1->pathname, f2->pathname ) );
>     return 0;
> }
>
> How can I detect that the index wouldn't be filled properly and
> thus I need
> to zero it manually?

There's a Dpathconf() opcode which returns a bitset, which *should* indicate
whether the index information returned is reliable.