1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 htri_t
 ss_scope_iswritable(ss_scope_t *scope   /* Any open scope. */
                     )
 {
     SS_ENTER(ss_scope_iswritable, htri_t);
     htri_t      retval=FALSE;
     ss_gfile_t  *gfile=NULL;

     /* Check whether the H5F_ACC_RDWR bit is set on the file. If the file is read-only then all scopes in the file are also
      * read-only. This allows the client to create a transient scope (e.g., to serve as a standard registry) and then mark the
      * entire file as read-only in order to prevent modification of it's objects and to make the library more efficient (there
      * are certain time-saving assumptions that can be made if a file is read-only). */
     if (NULL==(gfile=SS_GFILE_LINK(scope))) SS_ERROR(NOTFOUND);
     if (gfile->flags & H5F_ACC_RDWR) {
         /* If the file is writable then check the scope's flags. */
         if (ss_scope_isopen(scope)<=0) SS_ERROR(NOTOPEN);
         if (SS_SCOPE(scope)->m.flags & H5F_ACC_RDWR) retval=TRUE;
     }

 SS_CLEANUP:
     SS_LEAVE(retval);
 }