Test program used to test the DMAPI function dm_get_dmattr(). The
command line is:
- get_dmattr [-b buflen] [-s sid] [-t token] pathname attr
+ get_dmattr [-b buflen] [-s sid] [-t token] {pathname|handle} attr
where pathname is the name of a file, buflen is the size of the buffer to use
in the call, attr is the name of the DMAPI attribute, and sid is the session ID
usage(void)
{
fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-t token] "
- "pathname attr\n", Progname);
+ "{pathname|handle} attr\n", Progname);
exit(1);
}
{
dm_sessid_t sid = DM_NO_SESSION;
dm_token_t token = DM_NO_TOKEN;
- char *pathname;
+ char *object;
dm_attrname_t *attrnamep;
void *bufp;
size_t buflen = 10000;
}
if (optind + 2 != argc)
usage();
- pathname = argv[optind++];
+ object = argv[optind++];
attrnamep = (dm_attrname_t *)argv[optind];
if (dm_init_service(&name) == -1) {
/* Get the file's handle. */
- if (dm_path_to_handle(pathname, &hanp, &hlen)) {
- fprintf(stderr, "can't get handle for file %s, %s\n",
- pathname, strerror(errno));
+ if (opaque_to_handle(object, &hanp, &hlen)) {
+ fprintf(stderr, "can't get handle for %s\n", object);
exit(1);
}
Test program used to test the DMAPI function dm_set_dmattr(). The
command line is:
- set_dmattr [-b buflen] [-s sid] [-u] pathname attr value
+ set_dmattr [-b buflen] [-s sid] [-u] {pathname|handle} attr value
where pathname is the name of a file, buflen is the size of the buffer to use
in the call, attr is the name of the DMAPI attribute, -u is selected if
static void
usage(void)
{
- fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-u] pathname "
- "attr value\n", Progname);
+ fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-u] "
+ "{pathname|handle} attr value\n", Progname);
exit(1);
}
char **argv)
{
dm_sessid_t sid = DM_NO_SESSION;
- char *pathname;
+ char *object;
dm_attrname_t *attrnamep;
char *bufp;
size_t buflen;
}
if (optind + 3 != argc)
usage();
- pathname = argv[optind++];
+ object = argv[optind++];
attrnamep = (dm_attrname_t *)argv[optind++];
bufp = argv[optind];
if (!bflag)
/* Get the file's handle. */
- if (dm_path_to_handle(pathname, &hanp, &hlen)) {
- fprintf(stderr, "can't get handle for file %s, %s\n",
- pathname, strerror(errno));
+ if (opaque_to_handle(object, &hanp, &hlen)) {
+ fprintf(stderr, "can't get handle for %s\n", object);
exit(1);
}