Using tar to access files
gedare at gwu.edu
Tue Jun 30 16:48:42 UTC 2015
On Tue, Jun 30, 2015 at 1:10 AM, Nick Withers <nick.withers at anu.edu.au> wrote:
> On Tue, 2015-06-30 at 10:09 +0530, Sujay Raj wrote:
>> I need to access configurations files the for web server I am porting to
>> I create a tar archive , that contains the required folders and files ,
>> convert it into c source using rtems-bin2c , ( a header file and a c source
>> ) and link them with my project.
>> In the init, I call
>> sc = Untar_FromMemory((void *)TARFILE_START, (size_t)TARFILE_SIZE);
> I'm not familiar with that function but I use rtems_tarfs_load()
> Not sure whether it needs CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS or
> other resources off the top of my head.
> P.S. It'd probably be best to send help requests like this to the users
I've used this Untar some. You might want to look into the file image
created, and even untar it with your host to see what it produces.
Here are the commands I use from an old repo (with CVS and SVN vc),
after placing the files in a directory called "files"
tar -cvf ../FileSystemImage --exclude CVS --exclude .cvsignore --exclude .svn .
rtems-bin2c FileSystemImage FileSystemImage
This creates the .c and .h files I need so that I can use in my init():
I also used
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40
#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK 512
All of this was awhile ago, but maybe these pointers will help you.
>> where TARFILE_START is the macro with the name of the array , TARFILE_SIZE
>> is the size of the array.
>> But when I run the program, I get errors of the form
>> "Untar: failed to create file <folder>/<filename>"
>> for all the files in the tar archive (there are about 10 files, 10 errors).
>> There are no build errors, and since my application recognizes files
>> present in the tar archive, I think possibly I am missing to initialize
>> Help would be really appreciated.
>> Thanks and Regards,
>> Sujay Raj
>> devel mailing list
>> devel at rtems.org
> devel mailing list
> devel at rtems.org
More information about the devel