• Post Reply Bookmark Topic Watch Topic
  • New Topic

(Help) creating tar file using java in linux  RSS feed

 
Chethan Sharma
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

i am using linux o/s.
i want to create a ".tar" file using a java program.
could you please help me in this context.
i would be more thankful if u provide me code.


thanks in advance.
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use runtime.exec to call the tar command, or search the Internet for a tar API.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One simple approach would just be to use the Runtime.exec() method to execute the Linux tar program with the appropriate arguments. Otherwise, I googled for this tar library -- no idea whether it's any good or not.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Chethan",

We're a friendly group, but we do require members to have valid display names. It appears that you had a valid display name but changed it. Please change it back.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with display names get deleted, often without warning

thanks,
Dave
 
Chethan Sharma
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for ur help.i am now able to create ".tar" file using Runtime.exec()


Originally posted by Ernest Friedman-Hill:
One simple approach would just be to use the Runtime.exec() method to execute the Linux tar program with the appropriate arguments. Otherwise, I googled for this tar library -- no idea whether it's any good or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!