a sample file to the current directory of a running test.
A uudecode filter test will use it for its new test.
TODO: make a symbolic link file insted of copying a sample file.
Historically, libarchive cannot handle uuencoded files when
libarchive's test suit was made. Now libarchive can handle it
directly by uudecode filter, I think, we can reduce copying
sample files to the directory test program expects they are
on an isolated directory for their test.
fclose(in);
}
+void
+copy_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+ size_t rbytes;
+
+ sprintf(buff, "%s/%s", refdir, name);
+ in = fopen(buff, "rb");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
+ fwrite(buff, 1, rbytes, out);
+ }
+ fclose(out);
+ fclose(in);
+}
+
int
is_LargeInode(const char *file)
{
/* Extracts named reference file to the current directory. */
void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
/* Path to working directory for current test */
extern const char *testworkdir;
fclose(in);
}
+void
+copy_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+ size_t rbytes;
+
+ sprintf(buff, "%s/%s", refdir, name);
+ in = fopen(buff, "rb");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
+ fwrite(buff, 1, rbytes, out);
+ }
+ fclose(out);
+ fclose(in);
+}
+
int
is_LargeInode(const char *file)
{
/* Extracts named reference file to the current directory. */
void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
/* Path to working directory for current test */
extern const char *testworkdir;
fclose(in);
}
+void
+copy_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+ size_t rbytes;
+
+ sprintf(buff, "%s/%s", refdir, name);
+ in = fopen(buff, "rb");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
+ fwrite(buff, 1, rbytes, out);
+ }
+ fclose(out);
+ fclose(in);
+}
+
int
is_LargeInode(const char *file)
{
/* Extracts named reference file to the current directory. */
void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
/* Extracts a list of files to the current directory.
* List must be NULL terminated.
fclose(in);
}
+void
+copy_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+ size_t rbytes;
+
+ sprintf(buff, "%s/%s", refdir, name);
+ in = fopen(buff, "rb");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
+ fwrite(buff, 1, rbytes, out);
+ }
+ fclose(out);
+ fclose(in);
+}
+
int
is_LargeInode(const char *file)
{
/* Extracts named reference file to the current directory. */
void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
/* Path to working directory for current test */
extern const char *testworkdir;