DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦7fc2189d1⟧ TextFile

    Length: 11464 (0x2cc8)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Directory;
with Text_Io;
with Calendar;
with Time_Utilities;
procedure Dir is
    Obj, Obj1, Obj2, The_Copy : Directory.Object;
    Parent : Directory.Object;  
    Path : constant String := "/home/aconit/projects/umps/directory/test";
    Item : Character;
begin
    begin
        Directory.Any_Object.Open (The_Object => Obj, Object_Name => Path);
    exception
        when Directory.Non_Existent_Object_Error =>
            begin
                Text_Io.Put_Line ("Le repertoire " & Path &
                                  " va etre cree ...");
                Directory.Any_Object.Create
                   (The_Object => Obj,
                    Object_Name => Path,
                    Object_Class => Directory.Directory_Class,
                    Object_Owner_Permissions =>
                       Directory.Statistics.R_W_X_Permission,
                    Object_Group_Permissions =>
                       Directory.Statistics.R_W_Permission,
                    Object_Other_Permissions =>
                       Directory.Statistics.R_W_Permission);
            exception
                when others =>
                    Text_Io.Put_Line ("Le repertoire " & Path &
                                      "n'a pas pu etre cree...");
                    return;
            end;
    end;
    declare
        I : Directory.Iterator;
        T : Calendar.Time;
    begin
        I := Directory.Traversal.Children (The_Object => Obj,
                                           Pattern => "*",
                                           Class => Directory.Unknown_Class);

        Text_Io.New_Line;
        Text_Io.Put_Line ("Le repertoire " & Directory.Naming.Full_Name (Obj) &
                          " est constitue des fichiers suivant :");

        while not Directory.Done (Iter => I) loop
            Obj1 := Directory.Value (Iter => I);
            T := Directory.Statistics.Time_Of_Last_Update (The_Object => Obj1);
            Text_Io.Put_Line
               (Directory.Naming.Simple_Name (The_Object => Obj1) & "   " &
                Directory.Image (The_Class =>
                                    Directory.Class (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Owner_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Group_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Other_Permissions
                                          (The_Object => Obj1)) &
                " " & Time_Utilities.Image
                         (Date => Time_Utilities.Convert_Time (T),
                          Date_Style => Time_Utilities.Day_Month_Year,
                          Time_Style => Time_Utilities.Short,
                          Contents => Time_Utilities.Both) &
                " " & Integer'Image (Directory.Statistics.Object_Size
                                        (The_Object => Obj1)));
            Directory.Next (Iter => I);
        end loop;


        Directory.Naming.Set_Default_Context
           ("/home/aconit/projects/umps/directory");

        Text_Io.New_Line;
        Text_Io.Put_Line
           ("Le context courant va etre le repertoire suivant : " &
            Directory.Naming.Full_Name (Directory.Naming.Default_Context));

        Text_Io.Put ("Appuyer une touche pour continuer...");
        Text_Io.Get (Item);

        Text_Io.New_Line;
        Text_Io.Put_Line ("Copy du repertoire " &
                          Directory.Naming.Full_Name (Obj) &
                          " dans le repertoire 'test_bis'");

        begin
            Directory.Any_Object.Copy (Source => Obj,
                                       Destination_Name => "test_bis",
                                       Destination => The_Copy);
            Text_Io.Put_Line ("La copy a reussie dans le repertoire " &
                              Directory.Naming.Full_Name
                                 (The_Object => The_Copy));
        exception
            when Directory.System_Error =>
                Text_Io.Put_Line ("Erreur system : " &
                                  Directory.Get_Error_Message);
            when others =>
                Text_Io.Put_Line ("Erreur rencontree lors de la copie ...");
        end;

        Text_Io.New_Line;
        Text_Io.Put_Line
           ("Le repertoire " & Directory.Naming.Full_Name (The_Copy) &
            " a ete cree et contient le(s) fichier(s) suivant(s) :");


        I := Directory.Traversal.Children (The_Object => The_Copy,
                                           Pattern => "*",
                                           Class => Directory.Unknown_Class);

        while not Directory.Done (Iter => I) loop
            Obj1 := Directory.Value (Iter => I);
            T := Directory.Statistics.Time_Of_Last_Update (The_Object => Obj1);
            Text_Io.Put_Line
               (Directory.Naming.Simple_Name (The_Object => Obj1) & "   " &
                Directory.Image (The_Class =>
                                    Directory.Class (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Owner_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Group_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Other_Permissions
                                          (The_Object => Obj1)) &
                " " & Time_Utilities.Image
                         (Date => Time_Utilities.Convert_Time (T),
                          Date_Style => Time_Utilities.Day_Month_Year,
                          Time_Style => Time_Utilities.Short,
                          Contents => Time_Utilities.Both) &
                " " & Integer'Image (Directory.Statistics.Object_Size
                                        (The_Object => Obj1)));
            Directory.Next (Iter => I);
        end loop;

        Text_Io.New_Line;
        Text_Io.Put ("Appuyer une touche pour continuer...");
        Text_Io.Get (Item);
        Text_Io.New_Line;


        Directory.Any_Object.Open (The_Object => Obj2,
                                   Object_Name => "test_bis/test2/test_file");
        Parent := Directory.Traversal.Parent (The_Object => Obj2);

        Text_Io.Put_Line ("Le repertoire " &
                          Directory.Naming.Full_Name (Parent) &
                          " contient le(s) fichier(s) suivant(s)");

        I := Directory.Traversal.Children (The_Object => Parent,
                                           Pattern => "*",
                                           Class => Directory.Unknown_Class);

        while not Directory.Done (Iter => I) loop
            Obj1 := Directory.Value (Iter => I);
            T := Directory.Statistics.Time_Of_Last_Update (The_Object => Obj1);
            Text_Io.Put_Line
               (Directory.Naming.Simple_Name (The_Object => Obj1) & "   " &
                Directory.Image (The_Class =>
                                    Directory.Class (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Owner_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Group_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Other_Permissions
                                          (The_Object => Obj1)) &
                " " & Time_Utilities.Image
                         (Date => Time_Utilities.Convert_Time (T),
                          Date_Style => Time_Utilities.Day_Month_Year,
                          Time_Style => Time_Utilities.Short,
                          Contents => Time_Utilities.Both) &
                " " & Integer'Image (Directory.Statistics.Object_Size
                                        (The_Object => Obj1)));
            Directory.Next (Iter => I);
        end loop;

        Text_Io.New_Line;
        Text_Io.Put ("Appuyer une touche pour continuer...");
        Text_Io.Get (Item);
        Text_Io.New_Line;



        Text_Io.Put_Line ("Le fichier " & Directory.Naming.Full_Name (Obj2) &
                          " vient d'etre efface");

        Directory.Any_Object.Delete (The_Object => Obj2);

        Text_Io.Put_Line ("Le repertoire " &
                          Directory.Naming.Full_Name (Parent) &
                          " vient d'etre efface");

        Directory.Any_Object.Delete (The_Object => Parent);

        Text_Io.New_Line;
        Text_Io.Put_Line ("Le contenu du repertoire " &
                          Directory.Naming.Full_Name (The_Copy) &
                          " est donc maintenant le suivant :");


        I := Directory.Traversal.Children (The_Object => The_Copy,
                                           Pattern => "*",
                                           Class => Directory.Unknown_Class);
        while not Directory.Done (Iter => I) loop
            Obj1 := Directory.Value (Iter => I);
            T := Directory.Statistics.Time_Of_Last_Update (The_Object => Obj1);
            Text_Io.Put_Line
               (Directory.Naming.Simple_Name (The_Object => Obj1) & "   " &
                Directory.Image (The_Class =>
                                    Directory.Class (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Owner_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Group_Permissions
                                          (The_Object => Obj1)) &
                Directory.Statistics.Image
                   (The_Permissions => Directory.Statistics.Other_Permissions
                                          (The_Object => Obj1)) &
                " " & Time_Utilities.Image
                         (Date => Time_Utilities.Convert_Time (T),
                          Date_Style => Time_Utilities.Day_Month_Year,
                          Time_Style => Time_Utilities.Short,
                          Contents => Time_Utilities.Both) &
                " " & Integer'Image (Directory.Statistics.Object_Size
                                        (The_Object => Obj1)));
            Directory.Next (Iter => I);
        end loop;

    exception
        when Directory.Non_Existent_Object_Error =>
            Text_Io.Put_Line
               ("Vous essayer d'ouvrir un fichier non exitant...");
        when Directory.Already_Existent_Object_Error =>
            Text_Io.Put_Line
               ("Vous essayer de creer un fichier deja existent...");
        when Directory.System_Error =>
            Text_Io.Put_Line ("Erreur system : " & Directory.Get_Error_Message);
    end;
end Dir;

pragma Main;