View previous topic :: View next topic |
Author |
Message |
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Mon Dec 19, 2011 8:52 am Post subject: [RISOLTO] Gestione file linux |
|
|
Salve a tutti,
so che è una domanda un po' sciocca, ma non me la sono mai fatta prima d'ora e adesso non trovo risposta su internet:
Come funziona la gestione dei file su Linux? Perché se apro un file e mentre lo sto visualizzando, lo cancello, riesco ancora a vederlo fino alla fine?
È perché ho solo cancellato il nome dell'i-node e il programma continua a leggere dal disco? Se è così, se io sovrascrivo quell'area mentre lo sto guardando cosa succede?
Grazie.
Last edited by UnoSD on Mon Dec 19, 2011 1:21 pm; edited 1 time in total |
|
Back to top |
|
|
darkmanPPT Veteran
Joined: 13 Apr 2006 Posts: 1069 Location: vi/bo
|
Posted: Mon Dec 19, 2011 10:53 am Post subject: |
|
|
Linux in realtà non c'entra un bel niente.
quel che c'entra è il Filesystem che stai usando!
ext3, ext2, FAT, FAT32, ntfs, xfs, etc... si comportano tutti in modo diverso.
c'è chi ha gli Inode e chi non gli ha.
chi ha una struttura ad albero e chi è sequenziale (leggasi FAT).
ordunque, rispondere alla tua domanda non è semplice.
ti interessa sapere qualcosa in particolare su qualche filesystem?
in generale, ti dico, wikipidia è ben fatta sui filesystem più importanti (come descrizione e funzionamento).
se invece stai cercando dei tool, esattamente cosa vorresti? _________________ Darkman |
|
Back to top |
|
|
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Mon Dec 19, 2011 10:55 am Post subject: |
|
|
È vero, ho dimenticato l'elemento fondamentale... È stata una distrazione, non ignoranza
Uso ext4! |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Mon Dec 19, 2011 12:27 pm Post subject: |
|
|
CONFIG_FHANDLE=Y _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Mon Dec 19, 2011 12:31 pm Post subject: |
|
|
Quote: | If you say Y here, a user level program will be able to map file names to handle and then later use the handle for different file system operations. This is useful in implementing userspace file servers, which now track files using handles instead of names. The handle would remain the same even if file names get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2) syscalls. |
Io non l'ho settata però i file li legge lo stesso anche quando li cancello... |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Mon Dec 19, 2011 12:38 pm Post subject: |
|
|
era per metterti sulla strada.
A quel che ricordo il descrittore ed il lock restano associati all'inode anche dopo la cancellazione.
Più che dal filesystem (inteso come struttura) dipende dal caching del kernel, impostazioni come fhandle e dal codice che lo gestisce (mantenere di fatto l'area del file bloccata aumenta la frammentazione).
Prova ad aprire un file video di una ventina di GB e cancellalo. Vedrai che dopo un poco si blocca. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Mon Dec 19, 2011 12:42 pm Post subject: |
|
|
Ah, ok, quindi era come immaginavo!
Ma come mai funziona se nel mio kernel non è settata? (non settata la mette lui automaticamente a y?)
Grazie della risposta comunque! |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Mon Dec 19, 2011 1:15 pm Post subject: |
|
|
Se la usi ti consente di non avere problemi se rinomini il file o se lo sposti.
Altrimenti è come quando li cancelli adesso e continui ad accedere solo fino a che le informazioni raccolte te lo consentono. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
UnoSD Apprentice
Joined: 27 Jun 2011 Posts: 273
|
Posted: Mon Dec 19, 2011 1:21 pm Post subject: |
|
|
Tutto chiaro, grazie ancora! |
|
Back to top |
|
|
|