test/test_physfs.c
changeset 654 c0ae01de361d
parent 625 60b5f566a258
child 681 451025285d35
equal deleted inserted replaced
653:89d56fcb2b40 654:c0ae01de361d
   326     num = atoi(args);
   326     num = atoi(args);
   327     if (num < 0)
   327     if (num < 0)
   328         printf("buffer must be greater than or equal to zero.\n");
   328         printf("buffer must be greater than or equal to zero.\n");
   329     else
   329     else
   330     {
   330     {
   331         PHYSFS_file *f;
   331         PHYSFS_File *f;
   332         int rndnum;
   332         int rndnum;
   333 
   333 
   334         printf("Stress testing with (%d) byte buffer...\n", num);
   334         printf("Stress testing with (%d) byte buffer...\n", num);
   335         f = PHYSFS_openWrite("test.txt");
   335         f = PHYSFS_openWrite("test.txt");
   336         if (f == NULL)
   336         if (f == NULL)
   643 } /* cmd_issymlink */
   643 } /* cmd_issymlink */
   644 
   644 
   645 
   645 
   646 static int cmd_cat(char *args)
   646 static int cmd_cat(char *args)
   647 {
   647 {
   648     PHYSFS_file *f;
   648     PHYSFS_File *f;
   649 
   649 
   650     if (*args == '\"')
   650     if (*args == '\"')
   651     {
   651     {
   652         args++;
   652         args++;
   653         args[strlen(args) - 1] = '\0';
   653         args[strlen(args) - 1] = '\0';
   697 } /* cmd_cat */
   697 } /* cmd_cat */
   698 
   698 
   699 
   699 
   700 static int cmd_filelength(char *args)
   700 static int cmd_filelength(char *args)
   701 {
   701 {
   702     PHYSFS_file *f;
   702     PHYSFS_File *f;
   703 
   703 
   704     if (*args == '\"')
   704     if (*args == '\"')
   705     {
   705     {
   706         args++;
   706         args++;
   707         args[strlen(args) - 1] = '\0';
   707         args[strlen(args) - 1] = '\0';
   727 
   727 
   728 #define WRITESTR "The cat sat on the mat.\n\n"
   728 #define WRITESTR "The cat sat on the mat.\n\n"
   729 
   729 
   730 static int cmd_append(char *args)
   730 static int cmd_append(char *args)
   731 {
   731 {
   732     PHYSFS_file *f;
   732     PHYSFS_File *f;
   733 
   733 
   734     if (*args == '\"')
   734     if (*args == '\"')
   735     {
   735     {
   736         args++;
   736         args++;
   737         args[strlen(args) - 1] = '\0';
   737         args[strlen(args) - 1] = '\0';
   775 } /* cmd_append */
   775 } /* cmd_append */
   776 
   776 
   777 
   777 
   778 static int cmd_write(char *args)
   778 static int cmd_write(char *args)
   779 {
   779 {
   780     PHYSFS_file *f;
   780     PHYSFS_File *f;
   781 
   781 
   782     if (*args == '\"')
   782     if (*args == '\"')
   783     {
   783     {
   784         args++;
   784         args++;
   785         args[strlen(args) - 1] = '\0';
   785         args[strlen(args) - 1] = '\0';