Copyright (C) 2000-2012 |
GNU Info (tar.info)appendHow to Add Files to Existing Archives: `--append' ------------------------------------------------- _(This message will disappear, once this node revised.)_ If you want to add files to an existing archive, you don't need to create a new archive; you can use `--append' (`-r'). The archive must already exist in order to use `--append'. (A related operation is the `--update' operation; you can use this to add newer versions of archive members to an existing archive. To learn how to do this with `--update', Note: update.) If you use `--append' (`-r') to add a file that has the same name as an archive member to an archive containing that archive member, then the old member is not deleted. What does happen, however, is somewhat complex. `tar' _allows_ you to have infinite numbers of files with the same name. Some operations treat these same-named members no differently than any other set of archive members: for example, if you view an archive with `--list' (`-t'), you will see all of those members listed, with their modification times, owners, etc. Other operations don't deal with these members as perfectly as you might prefer; if you were to use `--extract' (`--get', `-x') to extract the archive, only the most recently added copy of a member with the same name as four other members would end up in the working directory. This is because `--extract' extracts an archive in the order the members appeared in the archive; the most recently archived members will be extracted last. Additionally, an extracted member will _replace_ a file of the same name which existed in the directory already, and `tar' will not prompt you about this. Thus, only the most recently archived member will end up being extracted, as it will replace the one extracted before it, and so on. There are a few ways to get around this. If you want to replace an archive member, use `--delete' to delete the member you want to remove from the archive, , and then use `--append' to add the member you want to be in the archive. Note that you can not change the order of the archive; the most recently added member will still appear last. In this sense, you cannot truly "replace" one member with another. (Replacing one member with another will not work on certain types of media, such as tapes; see Note: delete and Note: Media, for more information.)
automatically generated by info2www version 1.2.2.9 |