Zerosquare (./3383) :Bof de toute façon le C c'est pas portable. CQFD
Donc c'est pas portable, CQFD.
Zerosquare (./3383) :Bof de toute façon le C c'est pas portable. CQFD
Donc c'est pas portable, CQFD.
Godzil (./3381) :MinGW comprend aussi fstat sans _.
Ce n'est pas fstat mais _fstat sous windows ( https://msdn.microsoft.com/en-us/library/aa246905(v=vs.60).aspx )
Godzil (./3385) :Tu as raison. C'est stat qu'il faut utiliser, pas fstat. Mais stat aussi existe aussi sous Windows (du moins MinGW, Visual C++ oblige probablement là aussi à rajouter le fameux underscore).
Mais vous faites tous erreur, vous confondez stat et fstat:
int stat(const char *pathname, struct stat *statbuf);
int fstat(int fd, struct stat *statbuf);
Uther (./3393) :Le C est très portable grâce à la norme POSIX. Il reste un seul système d'exploitation courant qui n'est toujours pas conforme.
Disons que la portabilité c'est toujours plus ou moins de l'esbroufe, mais y'a des fois ou ça se voit plus que d'autre. Le C a hérité sa réputation de portabilité de l'époque ou son principale concurrence dans son domaine était l'assembleur. Donc en effet il y avait pas photo.
Mais c'est clair que si on le compare aux nombreux langages moderne, il est clairement derrière.
Zerosquare (./3398) :TIGCC n'est pas vraiment une plateforme courante.
Et Kevin parle de Windows sans le nommer, mais il y a plein d'autres plateformes que les PC desktop qui utilisent du C.
https://github.com/npm/npm/issues/19883 :
This issue has been happening ever since 5.7.0 was released a few hours ago. It seems to have completely broken my filesystem permissions and caused me to have to manually fix the permissions of critical files and folders. I believe that it is related to the commit 94227e1 which is traversing and running chown on the wrong, often critical, filesystem files and folders.
By running sudo npm under a non-root user (root users do not have the same effect), filesystem permissions are being heavily modified. For example, if I run sudo npm --help or sudo npm update -g, both commands cause my filesystem to change ownership of directories such as /etc, /usr, /boot, and other directories needed for running the system. It appears that the ownership is recursively changed to the user currently running npm.
This isn't a bug, this is all working exactly as written and intended. There's a correctMkdir function that explicitly uses the sudo caller (not the effective or real user ID) to recursively chown any directory it is called to, and then this function is used all over the place, notably in places like the installation etc directory.
Apparently the npm developers feel they can do whatever they want with your system. Seriously, this isn't a subtle bug, this is code doing exactly what it claims to do. Which is stupid and clearly nobody tested this on a real system.