XBT_INFO("*** Move '/tmp/data.txt' into '/tmp/simgrid.readme'");
MSG_file_move(file, "/home/tmp/simgrid.readme");
+ // Attach some user data to the file
+ MSG_file_set_data(file, xbt_strdup("777"));
+ // Retrieve these data
+ char *data = MSG_file_get_data(file);
+ XBT_INFO("User data attached to the file: %s", data);
+
MSG_file_close(file);
free(file_name);
// Now attach some user data to disk1
XBT_INFO("*** Get/set data for storage element: %s ***",storage_name);
- char *data = MSG_storage_get_data(storage);
+ data = MSG_storage_get_data(storage);
- XBT_INFO("Get data: '%s'", data);
+ XBT_INFO("Get storage data: '%s'", data);
MSG_storage_set_data(storage, xbt_strdup("Some user data"));
data = MSG_storage_get_data(storage);
> Storage Type: 'single_SSD'
> Content Type: 'txt_unix'
> [ 0.007917] (1:(null)@denise) *** Move '/tmp/data.txt' into '/tmp/simgrid.readme'
+> [ 0.007917] (1:(null)@denise) User data attached to the file: 777
> [ 0.007917] (1:(null)@denise) *** Get/set data for storage element: Disk4 ***
-> [ 0.007917] (1:(null)@denise) Get data: '(null)'
+> [ 0.007917] (1:(null)@denise) Get storage data: '(null)'
> [ 0.007917] (1:(null)@denise) Set and get data: 'Some user data'
> [ 0.007917] (1:(null)@denise) *** Dump content of denise ***
> [ 0.007917] (1:(null)@denise) Print the content of mount point: c: