guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH shepherd v2] support: Ignore errors in mkdir-p when the direc


From: Ludovic Courtès
Subject: Re: [PATCH shepherd v2] support: Ignore errors in mkdir-p when the directories exist.
Date: Sat, 06 Feb 2016 14:22:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

David Michael <address@hidden> skribis:

> * modules/shepherd/support.scm (mkdir-p): Don't throw errors when
>   mkdir fails but the directory exists afterwards.

[...]

> -             (if (= EEXIST (system-error-errno args))
> +             (if (and (file-exists? path)
> +                      (eq? (stat:type (stat path)) 'directory))

This systematically does two ‘stat’ calls and can raise an exception if
PATH does not exist.

I’ve adjusted it in commit 66662cf such that on GNU/Linux there’s no
extra ‘stat’.

Thanks!

Ludo’.



reply via email to

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