hdf5/test/links.c
Robb Matzke b6fc6ede10 [svn-r346] Changes since 19980410
----------------------

./html/H5.format.html
./src/H5E.c
./src/H5Epublic.h
./src/H5F.c
./src/H5G.c
./src/H5Gent.c
./src/H5Gnode.c
./src/H5Gprivate.h
./src/h5ls.c
./test/Makefile.in
	Symbolic links are now supported.  The ./test/links program
	will create a `links.h5' file that demonstrates hard links,
	soft links, dangling links, and recursive links.  A symbolic
	link is a symbol table entity and doesn't have an object
	header.  It's format is described in H5.format.hml.

./src/H5G.c
./src/H5Gpublic.h
./src/h5ls.c
	Implemented H5Gstat() and H5Gget_linkval() as documented by
	Quincey.  The `H5G_type_t type' field of `H5G_stat_t' was
	changed to `int type' because H5G_type_t was already used and
	the `type' data type should be open-ended.

./src/H5Ffamily.c
	Removed an incorrect diagnostic message.

./test/big.c
	Added read/write calls to test partial I/O to big contiguous
	datasets.  With no arguments it writes to a dataset and prints
	the list of points written which should be redirected to a
	file.  With an argument (the name of a file containing the
	stdout of a run with no arguments) values are read from the
	dataset.  One would typically say `big >x && big x'.
1998-04-14 11:44:46 -05:00

64 lines
1.5 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (C) 1998 NCSA
* All rights reserved.
*
* Programmer: Robb Matzke <matzke@llnl.gov>
* Friday, April 10, 1998
*
* Purpose: Tests hard and soft (symbolic) links.
*/
#include <hdf5.h>
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Tests links.
*
* Return: Success: 0
*
* Failure: non-zero
*
* Programmer: Robb Matzke
* Friday, April 10, 1998
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
int
main (void)
{
hid_t file, scalar, grp, d1;
hsize_t size[1] = {1};
/* Create a file */
file = H5Fcreate ("links.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
scalar = H5Screate_simple (1, size, size);
/* Create a group */
grp = H5Gcreate (file, "grp1", 0);
H5Gclose (grp);
/* Create a dataset */
d1 = H5Dcreate (file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT);
H5Dclose (d1);
/* Create a hard link */
H5Glink (file, H5G_LINK_HARD, "d1", "grp1/hard");
/* Create a symbolic link */
H5Glink (file, H5G_LINK_SOFT, "/d1", "grp1/soft");
/* Create a symbolic link to something that doesn't exist */
H5Glink (file, H5G_LINK_SOFT, "foobar", "grp1/dangle");
/* Create a recursive symbolic link */
H5Glink (file, H5G_LINK_SOFT, "/grp1/recursive", "/grp1/recursive");
/* Close */
H5Sclose (scalar);
H5Fclose (file);
return 0;
}