tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] "mormalize_inc_dirs"


From: Edmund Grimley Evans
Subject: Re: [Tinycc-devel] "mormalize_inc_dirs"
Date: Sat, 7 Nov 2015 13:59:02 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

> Hum! You can:
> fopen("dir-to-test/__deleteme__", "w");
> If it succeeds, dir-to-test exists then call fclose and
> remove("dir-to-test/__deleteme__").

As I understand it, the problem to be solved is not determining
whether a directory exists, but determining whether two directories
are the same (even though the paths might look quite different). You
can do that under POSIX by comparing st_dev and st_ino.

I suppose you could check that neither PATH1/RANDOM_NAME nor
PATH2/RANDOM_NAME exists, then create one of them and see if the other
now exists. But in most cases the directories are not writable!

Does GCC have an alternative implementation for systems without stat?

Edmund



reply via email to

[Prev in Thread] Current Thread [Next in Thread]