Ciao a tutti, sto cercando di listare il contenuto di alcune directory utilizzando il comando "rsync": la cosa funziona soltanto nel caso in cui non vi siano spazi nel path che inserisco. Ho provato con:
ma nessuno di questi funziona.codice:Process p = Runtime.getRuntime().exec("rsync /path_to_dir/dir with spaces/"); Process p = Runtime.getRuntime().exec("rsync /path_to_dir/dir\ with\ spaces/"); Process p = Runtime.getRuntime().exec("rsync \"/path_to_dir/dir with spaces/\""); Process p = Runtime.getRuntime().exec("rsync /path_to_dir/\"dir with spaces\"/"); Process p = Runtime.getRuntime().exec(new String[]{"rsync", "/path_to_dir/\"dir with spaces\"/"});
Qualche suggerimento (utilizzando sempre il comando rsync, non la classe "File" per poi fare getChildren())?
Grazie

Rispondi quotando