Davide Pesavento | 0b6e1db | 2025-04-19 19:23:11 -0400 | [diff] [blame^] | 1 | # ndnputchunks |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 2 | |
Davide Pesavento | 0b6e1db | 2025-04-19 19:23:11 -0400 | [diff] [blame^] | 3 | **ndnputchunks** is a producer program that reads a file from the standard input, and makes |
| 4 | it available as a set of NDN Data segments. It appends version and segment number components |
| 5 | to the specified name as needed, according to the [NDN naming conventions]( |
| 6 | https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/). |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 7 | |
Davide Pesavento | 0b6e1db | 2025-04-19 19:23:11 -0400 | [diff] [blame^] | 8 | Files published by ndnputchunks can be fetched with [ndnget](../get/README.md). |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 9 | |
| 10 | ## Usage examples |
| 11 | |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 12 | The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3` |
| 13 | prefix: |
| 14 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 15 | ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 16 | |
| 17 | To find the published version you have to start ndnputchunks with the `-p` command line option, |
| 18 | for example: |
| 19 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 20 | ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 21 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 22 | This command will print the published version to standard output. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 23 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 24 | To publish Data with a specific version, you need to append a version component to the end of the |
| 25 | prefix. The version component must follow the aforementioned NDN naming conventions. For example, |
| 26 | the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix: |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 27 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 28 | ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 29 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 30 | If the specified version component is not valid, ndnputchunks will exit with an error. If no version |
| 31 | component is specified, one will be generated and appended to the name. |