SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Preserving owner:group and attributes in tar (mono/linux)

Last post 02-19-2009 12:26 PM by adrin. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-19-2009 12:26 PM

    • adrin
    • Not Ranked
    • Joined on 02-19-2009
    • Posts 3

    Preserving owner:group and attributes in tar (mono/linux)

    Hello,

    I have following code to create a tar.gz from a list of directories:

     

    public static void CreateTarGzArchive(ICollection<FileSystemInfo> source,  FileInfo destination, ProgressMessageHandler pmhProgressEvents)
            {

                Stream outStream = File.Create(destination.FullName);
                outStream = new GZipOutputStream(outStream);

                TarArchive archive = TarArchive.CreateOutputTarArchive(outStream);
                
                archive.ProgressMessageEvent+=pmhProgressEvents;
                archive.ApplyUserInfoOverrides = false;
                foreach(FileSystemInfo fsi in source)
                {
                    TarEntry entry = TarEntry.CreateEntryFromFile(fsi.FullName);
                    archive.WriteEntry(entry, true);
                }

                archive.Close();

       }

     

     

    The archive is created successfuly however neither file attributes (all files are marked +x as executables) nor file ownership information (root:root for all the files) is preserved... is there any way to solve it?

     From what i see in sourcecode ... such information is never set using filesystem data (rather user running the assembly??)

    Filed under: , , , , ,
Page 1 of 1 (1 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.