[Gllug] PHP Guru's
salsaman at xs4all.nl
salsaman at xs4all.nl
Mon Jul 19 11:19:57 UTC 2010
On Mon, July 19, 2010 10:39, Tethys wrote:
> --------
>
> salsaman at xs4all.nl writes:
>
>>I don't know if this is of any use, but I wrote a C function to check
>> free
>>space for the volume containing a given directory (the directory is
>>created temporarily if it does not exist).
>
> Bleurgh! Why not just recursively try statvfs(2) ascending higher up
> the directory tree until you find one that actually exists? No need to
> create a temporary directory for that. But if you absolutely must create
> a directory, can I introduce you to mkdir(2) and rmdir(2)?
>
> Your use of system("/bin/mkdir ...") and system("/bin/rm ...") makes my
> skin crawl :-)
"/bin/mkdir -p" and mkdir() do two different things. As do "/bin/rm -rf"
and rmdir() [ok, so the latter is not really applicable here].
Yes, I suppose I could have done something more elegant like you suggest,
but when singlehanedly coding 54 man years of code in just 8 years*, quick
and ugly cut and paste often beats slower and elegant :-)
*https://www.ohloh.net/p/lives (estimate)
Cheers,
salsaman
http://lives.sourceforge.net
>
> Tet
> --
> Gllug mailing list - Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
>
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list