Changeset 13855
- Timestamp:
- Jan 23, 2013, 10:30:23 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/rename-test.c
r13854 r13855 5 5 #include <stdio.h> 6 6 7 #include <unistd.h> /* sync() */ 7 #include <sys/types.h> /* stat() */ 8 #include <sys/stat.h> /* stat() */ 9 #include <unistd.h> /* stat(), sync() */ 8 10 9 11 #include "transmission.h" … … 465 467 tr_file_index_t i; 466 468 const tr_stat * st; 469 tr_file_stat * fst; 467 470 468 471 for (i=0; i<tor->info.fileCount; ++i) 469 472 { 473 int rv; 470 474 uint64_t j; 471 475 FILE * fp; … … 473 477 char * dirname; 474 478 const tr_file * file = &tor->info.files[i]; 479 struct stat sb; 475 480 476 481 path = tr_buildPath (tor->downloadDir, file->name, NULL); … … 481 486 fputc ('\0', fp); 482 487 fclose (fp); 483 sync ();484 488 485 489 tr_free (dirname); 486 490 tr_free (path); 487 } 488 491 492 path = tr_torrentFindFile (tor, i); 493 assert (path != NULL); 494 rv = stat (path, &sb); 495 assert (rv == 0); 496 fprintf (stderr, "%s:%d file %s size is %zu\n", __FILE__, __LINE__, path, (size_t)sb.st_size); 497 tr_free (path); 498 } 499 500 sync (); 489 501 verify_and_block_until_done (tor); 490 502 st = tr_torrentStat (tor); 503 fprintf (stderr, "%s:%d leftUntilDone %zu\n", __FILE__, __LINE__, (size_t)st->leftUntilDone); 504 fst = tr_torrentFiles (tor, NULL); 505 for (i=0; i<3; ++i) 506 fprintf (stderr, "%s:%d %d %zu\n", __FILE__, __LINE__, (int)i, (size_t)fst[i].bytesCompleted); 491 507 assert (st->leftUntilDone == 0); 492 508 … … 503 519 fputc ('\1', fp); 504 520 fclose (fp); 505 sync ();506 521 507 522 tr_free (newpath); 508 523 tr_free (oldpath); 509 524 525 sync (); 510 526 verify_and_block_until_done (tor); 511 527 st = tr_torrentStat (tor); 512 528 assert (st->leftUntilDone == tor->info.pieceSize); 529 fprintf (stderr, "%s:%d leftUntilDone %zu\n", __FILE__, __LINE__, (size_t)st->leftUntilDone); 513 530 } 514 531 }
Note: See TracChangeset
for help on using the changeset viewer.