1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2001 Silicon Graphics, Inc.
7 /* Given a file object's pathname, print the object's handle. */
13 /*---------------------------------------------------------------------------
15 Test program used to test dm_path_to_handle(). The command line is:
17 path_to_handle pathname
19 where pathname is the name of a file, directory, or symlink.
21 ----------------------------------------------------------------------------*/
30 fprintf(stderr, "usage:\t%s pathname\n", Progname);
46 Progname = strrchr(argv[0], '/');
57 (void)dm_init_service(&name);
59 if (dm_path_to_handle(pathname, &hanp, &hlen) != 0) {
60 fprintf(stderr, "dm_path_to_handle failed, %s\n",
64 hantoa(hanp, hlen, buffer);
65 fprintf(stdout, "%s\n", buffer);
67 dm_handle_free(hanp, hlen);