Mail Archives: djgpp/1998/02/25/10:54:57
On Wed, 25 Feb 1998, Dim Zegebart wrote:
> _fixedpath(ini_name,fixed_name);
>
> // What do you thinking about contents of fixed_name now ? Yes, I also
> think it's just 'my_ini.ini'
Wrong!
> // But the real contents after _fixedpath is :
> 'c:/djgpp/contrib/mywork/my_ini.ini' exactly where from I running my exe
> file !
That's exactly what `_fixpath' is supposed to do. It canonicalizes the
file name. ``Canonicalizing'' means that it adds the drive and the
current directory, if they aren't already there, and resolves "." and
".." if present. It also does other useful things, like converting all
slashes to forward variety; see the libc docs.
What exactly is the problem?
> But, how I should allocate space for fixed_name exept declaring it as
> 'char fixed_name[MAXDIR]' ?
Either
char fixed_path[FILENAME_MAX];
or
char fixed_path[PATH_MAX];
The first is ANSI C (defined on stdio.h), the second is POSIX (defined in
limits.h).
- Raw text -