On 07/11/2018 02:55 PM,
nicolas.pechon@laposte.net wrote:
Bonjour, Oui, le ~ est expansé par le shell. Dans ton programme il faut faire l'expansion equivalente (voir glob(7)), par exemple: char *path = NULL; char* home = getenv("HOME"); if (!home) exit(EXIT_FAILURE); if (asprintf(&path, "%s/toto", home) < 0) exit(EXIT_FAILURE); if (mkdir (path, 0750)) { perror(path); exit(EXIT_FAILURE); } Cordialement -- Basile STARYNKEVITCH == http://starynkevitch.net/Basile opinions are mine only - les opinions sont seulement miennes Bourg La Reine, France |