store file permissions and apply them elsewhere

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Jan 5 23:50:17 EET 2008


On 2008-01-05 23:33, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> On 2008-01-05 12:58, asdf asdf <vindicator00 at gmail.com> wrote:
> > H erwthsh einai :
> >
> > an uparxei tropos na apo8hkeusei kapoios ta file permissions enos
> > system kapou kai katopin na ta metaferei kai na ta kanei apply se
> > kapoio allo susthma ( pou trexei paromoio distro )
> >
> > Yparxei kapoio etoimo tool gia na to kanei auto ?  H kalutera na ftiaxtei
> > kapoio script ?
>
> Είναι εύκολο να γράψεις ένα Python script που το κάνει αυτό.
>
> Θα μπορούσε π.χ. να είναι ένα script που «μετασχηματίζει» μια λίστα από
> filenames σε μία λίστα από tuples:
>
>     [ filename ] -> [ (filename, uid, gid, mode) ]

Ένα άλλο `tricky' μέρος σε αυτή την ιστορία είναι ότι δε μπορείς να
τυπώσεις απλά το binary mode ενός file σε octal και να υποθέσεις ότι στο
target σύστημα θα έχει το ίδιο νόημα.

Π.χ. αν αρχίσεις και μπλέκεις με extended file attributes (read-only,
append-only, undeletable, κλπ.) θα έχει αρκετό «ενδιαφέρον» η ιστορία :)




More information about the Linux-greek-users mailing list