@@ -102,28 +102,37 @@ impl Group {
102
102
Self :: from_id ( h5try ! ( H5Gopen2 ( self . id( ) , name. as_ptr( ) , H5P_DEFAULT ) ) )
103
103
}
104
104
105
- /// Creates a soft link. Note: `src` and `dst` are relative to the current object.
106
- pub fn link_soft ( & self , src : & str , dst : & str ) -> Result < ( ) > {
105
+ /// Creates a soft link.
106
+ ///
107
+ /// A soft link does not require the linked object to exist.
108
+ /// Note: `target` and `link_name` are relative to the current object.
109
+ pub fn link_soft ( & self , target : & str , link_name : & str ) -> Result < ( ) > {
107
110
// TODO: &mut self?
108
111
h5lock ! ( {
109
112
let lcpl = make_lcpl( ) ?;
110
- let src = to_cstring( src) ?;
111
- let dst = to_cstring( dst) ?;
112
- h5call!( H5Lcreate_soft ( src. as_ptr( ) , self . id( ) , dst. as_ptr( ) , lcpl. id( ) , H5P_DEFAULT ) )
113
- . and( Ok ( ( ) ) )
113
+ let target = to_cstring( target) ?;
114
+ let link_name = to_cstring( link_name) ?;
115
+ h5call!( H5Lcreate_soft (
116
+ target. as_ptr( ) ,
117
+ self . id( ) ,
118
+ link_name. as_ptr( ) ,
119
+ lcpl. id( ) ,
120
+ H5P_DEFAULT
121
+ ) )
122
+ . and( Ok ( ( ) ) )
114
123
} )
115
124
}
116
125
117
- /// Creates a hard link. Note: `src ` and `dst ` are relative to the current object.
118
- pub fn link_hard ( & self , src : & str , dst : & str ) -> Result < ( ) > {
126
+ /// Creates a hard link. Note: `target ` and `link_name ` are relative to the current object.
127
+ pub fn link_hard ( & self , target : & str , link_name : & str ) -> Result < ( ) > {
119
128
// TODO: &mut self?
120
- let src = to_cstring ( src ) ?;
121
- let dst = to_cstring ( dst ) ?;
129
+ let target = to_cstring ( target ) ?;
130
+ let link_name = to_cstring ( link_name ) ?;
122
131
h5call ! ( H5Lcreate_hard (
123
132
self . id( ) ,
124
- src . as_ptr( ) ,
133
+ target . as_ptr( ) ,
125
134
H5L_SAME_LOC ,
126
- dst . as_ptr( ) ,
135
+ link_name . as_ptr( ) ,
127
136
H5P_DEFAULT ,
128
137
H5P_DEFAULT
129
138
) )
@@ -132,21 +141,24 @@ impl Group {
132
141
133
142
/// Creates an external link.
134
143
///
135
- /// Note: `dst` is relative to the current object, `src` is relative to the root of the source file,
136
- /// `src_file_path` is the path to the external file.
144
+ /// Note: `link_name` is relative to the current object,
145
+ /// `target` is relative to the root of the source file,
146
+ /// `target_file_name` is the path to the external file.
137
147
///
138
- /// For a detailed explanation on how `src_file_path ` is resolved, see
148
+ /// For a detailed explanation on how `target_file_name ` is resolved, see
139
149
/// [https://portal.hdfgroup.org/display/HDF5/H5L_CREATE_EXTERNAL](https://portal.hdfgroup.org/display/HDF5/H5L_CREATE_EXTERNAL)
140
- pub fn link_external ( & self , src_file_path : & str , src : & str , dst : & str ) -> Result < ( ) > {
150
+ pub fn link_external (
151
+ & self , target_file_name : & str , target : & str , link_name : & str ,
152
+ ) -> Result < ( ) > {
141
153
// TODO: &mut self?
142
- let src = to_cstring ( src ) ?;
143
- let src_file_name = to_cstring ( src_file_path ) ?;
144
- let dst = to_cstring ( dst ) ?;
154
+ let target = to_cstring ( target ) ?;
155
+ let target_file_name = to_cstring ( target_file_name ) ?;
156
+ let link_name = to_cstring ( link_name ) ?;
145
157
h5call ! ( H5Lcreate_external (
146
- src_file_name . as_ptr( ) ,
147
- src . as_ptr( ) ,
158
+ target_file_name . as_ptr( ) ,
159
+ target . as_ptr( ) ,
148
160
self . id( ) ,
149
- dst . as_ptr( ) ,
161
+ link_name . as_ptr( ) ,
150
162
H5P_DEFAULT ,
151
163
H5P_DEFAULT ,
152
164
) )
0 commit comments