Warning: Undefined array key "view" in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php:2) in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 47
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php:2) in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 48
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php:2) in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 49
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php:2) in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 50
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php:2) in /var/www/html/wp-content/uploads/classes/so/1920/lab-examples/index.php on line 51
/**
* reimplementazione del comando 'mv':
* limitato al caso di file sullo stesso file-system
*/
#include
#include
#include
int main(int argc, char *argv[]) {
if (argc != 3) {
fprintf(stderr, "utilizzo: %s \n", argv[0]);
exit(1);
}
/* crea un hard-link a partire dal file esistente */
if (link(argv[1], argv[2]) == -1) {
perror(argv[2]);
exit(1);
}
/* rimuove il vecchio riferimento al file */
if (unlink(argv[1]) == -1) {
perror(argv[1]);
exit(1);
}
/* il file รจ stato spostato e/o rinominato istantaneamente (a prescindere dalla sua dimensione) */
}