Lines Matching defs:file

24  * DESCRIPTION: Query for file overwrite if it already exists.
58 * RETURN: Open file handle
60 * DESCRIPTION: Open a text output file for acpidump. Checks if file already
67 ACPI_FILE file;
69 /* If file exists, prompt for overwrite */
75 /* Point stdout to the file */
77 file = fopen(pathname, "w");
78 if (!file) {
79 fprintf(stderr, "Could not open output file: %s\n", pathname);
83 /* Save the file and path */
85 gbl_output_file = file;
99 * DESCRIPTION: Write an ACPI table to a binary file. Builds the output
108 ACPI_FILE file;
141 "Writing [%4.4s] to binary file: %s 0x%X (%u) bytes\n",
146 /* Open the file and dump the entire table in binary mode */
148 file = fopen(filename, "wb");
149 if (!file) {
150 fprintf(stderr, "Could not open output file: %s\n", filename);
154 actual = fwrite(table, 1, table_length, file);
156 fprintf(stderr, "Error writing binary output file: %s\n",
158 fclose(file);
162 fclose(file);
171 * out_file_size - Where the file size is returned
175 * DESCRIPTION: Open a file and read it entirely into a new buffer
183 ACPI_FILE file;
189 file = fopen(pathname, "rb");
190 if (!file) {
191 fprintf(stderr, "Could not open input file: %s\n", pathname);
195 /* Need file size to allocate a buffer */
197 file_size = cm_get_file_size(file);
200 "Could not get input file size: %s\n", pathname);
204 /* Allocate a buffer for the entire file */
209 "Could not allocate file buffer of size: %u\n",
214 /* Read the entire file */
216 actual = fread(buffer, 1, file_size, file);
218 fprintf(stderr, "Could not read input file: %s\n", pathname);
227 fclose(file);