[so] Teste Tema 3 linux

Paul Boglis boglis.paul at gmail.com
Mon Aug 31 15:59:28 EEST 2009


La problema cu inchiderea fisierelor voi spune doar cum deschi fiserul de
ram si cum il inchid. Fac la fel si la swap.
f_ram= open ("ram",  O_CREAT | O_RDWR, 0666);
    if (f_ram < 0)
    {
        perror("Eroare RAM\n");
    }
    if (ftruncate(f_ram, phys_pages * pageSize) < 0)
    {
            perror("Eroare ftruncate RAM\n");
    }
Iar la inchidere
if (close (f_ram)==-1){
    perror("close ram");
    return -1;
}
if (unlink("ram") == -1) {
    perror("RAM");
    return -1;
}
Dupa cum am zis la swap am facut identic doar ca au fost schimbate numele si
notatiile.
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090831/0522b40b/attachment.htm>


More information about the so mailing list