Default property list question


#1

If I create a file with default property lists

  1. get_create_plist is equal to H5P.create(H5P.FILE_CREATE), but

  2. get_access_plist is not equal to H5P.create(H5P.FILE_ACCESS)
    Is this a bug or expected?

    void Main()
    {
    long hf = H5F.create(@“d:\test_propertylists.h5”, H5F.ACC_TRUNC, H5P.DEFAULT, H5P.DEFAULT);

     uint maj = 0;
     uint min = 0;
     uint rev = 0;
     H5.get_libversion(ref maj, ref min, ref rev);
     new Version((int)maj, (int)min, (int)rev).Dump("version");
    
     long hcpl1 = 0;
     long hcpl2 = 0;
     long hapl1 = 0;
     long hapl2 = 0;
    
     try
     {
     	// I expect these to be equal
     	hcpl1 = H5F.get_create_plist(hf);
     	hcpl2 = H5P.create(H5P.FILE_CREATE);
     	
     	// which is the case
     	AreEqual(hcpl1, hcpl2).Dump("create");
    
     	// And these to be equal
     	hapl1 = H5F.get_access_plist(hf);
     	hapl2 = H5P.create(H5P.FILE_ACCESS);
    
     	// which is *not* the case - bug or design?
     	AreEqual(hapl1, hapl2).Dump("access");
     }
     finally
     {
     	H5P.close(hcpl1);
     	H5P.close(hcpl2);
     	H5P.close(hapl1);
     	H5P.close(hapl2);
     	H5F.close(hf);
     }
    

    }

    bool AreEqual(long h1, long h2)
    {
    int retval = H5P.equal(h1, h2);

     if(retval < 0)
     	throw new InvalidOperationException("error");
    
     retval.Dump();
     
     return retval > 0;
    

    }


#2

I believe this is not a bug, but admittedly unexpected from a user’s perspective. Passing H5P_DEFAULT to an API instructs the library to construct/utilize an instance of the required property list class with the default properties for that class. For a file access property, for example, this means to use the POSIX VFD, which is one of the default properties for this class. This is not equivalent to H5Pcreate(H5P_FILE_ACCESS), which creates just an empty file access property list, I believe.

G.