Re: Dia ChangeLog report for Wed Apr 9 07:23:01 2003 (UTC)
From: Ben Hetland <Ben A Hetland sintef no>
To: dia-list gnome org
Subject: Re: Dia ChangeLog report for Wed Apr 9 07:23:01 2003 (UTC)
Date: Fri, 11 Apr 2003 10:29:29 +0200
Michael Wybrow wrote:
>
> On Wed, 9 Apr 2003, Dia ChangeLog Daemon wrote:
> >
> > + * lib/dia_dirs.h:
> > + * lib/dia_dirs.c (dia_config_ensure_dir): New function to ensure
> > + that dirs are present.
>
> The use of `mkdir()' for this function is not portable -- It's part of
> glibc, but won't compile in MSVC. Does anyone know if there is a MSVC
> equivilent?
Hmmm... I don't know why MSVC doesn't have that function, as Microsoft
claims to be completely POSIX-compliant with all their NT-family of
operating systems, and 'mkdir()' I think is part of that standard.
But anyway, simply pressing F1 and searching the index for "mkdir" gave
me the following compiler-specific functions on MSVC6:
int _mkdir( const char *dirname );
int _wmkdir( const wchar_t *dirname );
Routine Required Header Compatibility
_mkdir <direct.h> Win 95, Win NT
_wmkdir <direct.h> or <wchar.h> Win NT
I guess you could use one of those, testing on the preprocessor
G_PLATFORM_WIN32 symbol.
And FWIW, using forward slashes as directory delimiters are pretty safe
on MS OSes too, they have been supported internal all since the DOS
days.
-+-Ben-+-