/ Check-in [baf95a19]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix the extension01.test script so that it works on windows. Fix a harmless compiler warning in the fileio extension.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:baf95a190907d05a847ae8b6a3dd60625c2a078a
User & Date: drh 2014-06-16 12:51:56
Context
2014-06-16
15:01
Add the ".eqp" dot-command to the ".help" output in the command-line shell. This was accidently omitted when the ".eqp" command was originally implemented for SQLite 3.8.4 (check-in [e6ecf7337658624]). check-in: b0b4c776 user: drh tags: trunk
12:51
Fix the extension01.test script so that it works on windows. Fix a harmless compiler warning in the fileio extension. check-in: baf95a19 user: drh tags: trunk
12:44
Add test cases for the fileio extension. check-in: 86343331 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/misc/fileio.c.

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  FILE *out;
  const char *z;
  int n;
  long rc;
  const char *zFile;

  zFile = (const char*)sqlite3_value_text(argv[0]);
  if( zFile==0 ) return;
  out = fopen(zFile, "wb");
  if( out==0 ) return;
  z = (const char*)sqlite3_value_blob(argv[1]);







|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  FILE *out;
  const char *z;
  int n;
  sqlite3_int64 rc;
  const char *zFile;

  zFile = (const char*)sqlite3_value_text(argv[0]);
  if( zFile==0 ) return;
  out = fopen(zFile, "wb");
  if( out==0 ) return;
  z = (const char*)sqlite3_value_blob(argv[1]);

Changes to test/extension01.test.

56
57
58
59
60
61
62

63



64
65
66
67
68

69



70
71
72
73
74
75
  }
} {0}
do_test 1.5 {
  file size ./file2.txt
} {0}

do_test 1.6 {

  file attributes ./file2.txt -permissions r--r--r--



  db eval {
    SELECT writefile('./file2.txt', 'Another test');
  }
} {nil}
do_test 1.7 {

  file attributes ./file2.txt -permissions rw-r--r--



  db eval {
    SELECT writefile(NULL, 'Another test');
  }
} {nil}

finish_test







>
|
>
>
>





>
|
>
>
>






56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  }
} {0}
do_test 1.5 {
  file size ./file2.txt
} {0}

do_test 1.6 {
  if {$::tcl_platform(platform)=="unix"} {
    file attributes ./file2.txt -permissions r--r--r--
  } else {
    file attributes ./file2.txt -readonly 1
  }
  db eval {
    SELECT writefile('./file2.txt', 'Another test');
  }
} {nil}
do_test 1.7 {
  if {$::tcl_platform(platform)=="unix"} {
    file attributes ./file2.txt -permissions rw-r--r--
  } else {
    file attributes ./file2.txt -readonly 0
  }
  db eval {
    SELECT writefile(NULL, 'Another test');
  }
} {nil}

finish_test