+ // lets toy with executing an application
+ if ( do_exec ) {
+
+ if ( ! pndrun ) {
+ printf ( "*** Couldn't locate a pnd runscript.\n" );
+ } else {
+ printf ( "Found a pnd runscript of %s\n", pndrun );
+
+ pnd_disco_t *d = pnd_box_get_head ( applist );
+ if ( d ) {
+ d = pnd_box_get_next ( d );
+
+ if ( d ) {
+ char fullpath [ FILENAME_MAX ];
+ if ( d -> object_type == pnd_object_type_directory ) {
+ sprintf ( fullpath, "%s", d -> object_path );
+ } else if ( d -> object_type == pnd_object_type_pnd ) {
+ sprintf ( fullpath, "%s/%s", d -> object_path, d -> object_filename );
+ }
+
+ printf ( "Guessing appdata path..\n" );
+ char appdata_path [ 1024 ];
+ pnd_get_ro_mountpoint ( fullpath, d -> unique_id, appdata_path, 1024 );
+ printf ( "Guessed readonly app mountpoint '%s'\n", appdata_path );
+ if ( pnd_get_appdata_path ( fullpath, d -> unique_id, appdata_path, 1024 ) ) {
+ printf ( " Appdata should be: %s\n", appdata_path );
+ } else {
+ printf ( " Error determining appdata path..\n" );
+ }
+
+ printf ( "Trying to exec '%s'\n", fullpath );
+ pnd_apps_exec ( pndrun, fullpath, d -> unique_id, d -> exec, d -> startdir, NULL, atoi ( d -> clockspeed ), PND_EXEC_OPTION_BLOCK );
+ }
+ }
+
+ }
+
+ } // do_exec?
+