• [^] # Re: fcntl

    Posté par . En réponse au message Locker un fichier. Évalué à 4.


    [yatt@localhost l]$ echo test > foo.bar
    [yatt@localhost l]$ nohup ./main &
    [1] 24352
    nohup: ignoring input and appending output to `nohup.out'
    [yatt@localhost l]$ cat foo.bar
    test
    [yatt@localhost l]$ cat foo.bar
    test


    Sauf que là ton lock fonctionne !
    Tu fais une lecture du fichier avec cat, pas une écriture. Forcément, si tu met un lock en écriture uniquement, il va autoriser à lire...