Lines Matching refs:file

2 Test ftruncate() function : usage variations - truncate file to smaller size
13 Description: Truncates a file to a given length
16 /* truncate the file to smaller size and display the content */
18 // include common file related test functions
19 include ("file.inc");
23 /* test ftruncate with file opened in different modes */
32 echo "\n-- Testing ftruncate() with file having data of type ". $file_content_type ." --\n";
35 echo "-- Testing ftruncate() with file opening using $file_modes[$mode_counter] mode --\n";
37 // create 1 file with some contents
40 // fopen the file using the $file_modes
45 // fopen the file using the $file_modes
49 echo "Error: failed to open file $filename!\n";
53 rewind($file_handle); // file pointer to 0
55 echo "-- Testing ftruncate(): truncate to smaller size and display the file content --\n";
56 /* try to truncate it and display the file content */
62 echo "File content after truncating file to $new_size size : ";
80 -- Testing ftruncate() with file having data of type numeric --
81 -- Testing ftruncate() with file opening using r mode --
82 -- Testing ftruncate(): truncate to smaller size and display the file content --
88 -- Testing ftruncate() with file opening using rb mode --
89 -- Testing ftruncate(): truncate to smaller size and display the file content --
95 -- Testing ftruncate() with file opening using rt mode --
96 -- Testing ftruncate(): truncate to smaller size and display the file content --
102 -- Testing ftruncate() with file opening using r+ mode --
103 -- Testing ftruncate(): truncate to smaller size and display the file content --
106 File content after truncating file to 15 size : string(15) "222222222222222"
110 -- Testing ftruncate() with file opening using r+b mode --
111 -- Testing ftruncate(): truncate to smaller size and display the file content --
114 File content after truncating file to 15 size : string(15) "222222222222222"
118 -- Testing ftruncate() with file opening using r+t mode --
119 -- Testing ftruncate(): truncate to smaller size and display the file content --
122 File content after truncating file to 15 size : string(15) "222222222222222"
126 -- Testing ftruncate() with file opening using w mode --
127 -- Testing ftruncate(): truncate to smaller size and display the file content --
130 File content after truncating file to 15 size : string(15) "222222222222222"
134 -- Testing ftruncate() with file opening using wb mode --
135 -- Testing ftruncate(): truncate to smaller size and display the file content --
138 File content after truncating file to 15 size : string(15) "222222222222222"
142 -- Testing ftruncate() with file opening using wt mode --
143 -- Testing ftruncate(): truncate to smaller size and display the file content --
146 File content after truncating file to 15 size : string(15) "222222222222222"
150 -- Testing ftruncate() with file opening using w+ mode --
151 -- Testing ftruncate(): truncate to smaller size and display the file content --
154 File content after truncating file to 15 size : string(15) "222222222222222"
158 -- Testing ftruncate() with file opening using w+b mode --
159 -- Testing ftruncate(): truncate to smaller size and display the file content --
162 File content after truncating file to 15 size : string(15) "222222222222222"
166 -- Testing ftruncate() with file opening using w+t mode --
167 -- Testing ftruncate(): truncate to smaller size and display the file content --
170 File content after truncating file to 15 size : string(15) "222222222222222"
174 -- Testing ftruncate() with file opening using x mode --
175 -- Testing ftruncate(): truncate to smaller size and display the file content --
178 File content after truncating file to 15 size : string(15) "222222222222222"
182 -- Testing ftruncate() with file opening using xb mode --
183 -- Testing ftruncate(): truncate to smaller size and display the file content --
186 File content after truncating file to 15 size : string(15) "222222222222222"
190 -- Testing ftruncate() with file opening using xt mode --
191 -- Testing ftruncate(): truncate to smaller size and display the file content --
194 File content after truncating file to 15 size : string(15) "222222222222222"
198 -- Testing ftruncate() with file opening using x+ mode --
199 -- Testing ftruncate(): truncate to smaller size and display the file content --
202 File content after truncating file to 15 size : string(15) "222222222222222"
206 -- Testing ftruncate() with file opening using x+b mode --
207 -- Testing ftruncate(): truncate to smaller size and display the file content --
210 File content after truncating file to 15 size : string(15) "222222222222222"
214 -- Testing ftruncate() with file opening using x+t mode --
215 -- Testing ftruncate(): truncate to smaller size and display the file content --
218 File content after truncating file to 15 size : string(15) "222222222222222"
222 -- Testing ftruncate() with file opening using a mode --
223 -- Testing ftruncate(): truncate to smaller size and display the file content --
226 File content after truncating file to 15 size : string(15) "222222222222222"
230 -- Testing ftruncate() with file opening using ab mode --
231 -- Testing ftruncate(): truncate to smaller size and display the file content --
234 File content after truncating file to 15 size : string(15) "222222222222222"
238 -- Testing ftruncate() with file opening using at mode --
239 -- Testing ftruncate(): truncate to smaller size and display the file content --
242 File content after truncating file to 15 size : string(15) "222222222222222"
246 -- Testing ftruncate() with file opening using a+ mode --
247 -- Testing ftruncate(): truncate to smaller size and display the file content --
250 File content after truncating file to 15 size : string(15) "222222222222222"
254 -- Testing ftruncate() with file opening using a+b mode --
255 -- Testing ftruncate(): truncate to smaller size and display the file content --
258 File content after truncating file to 15 size : string(15) "222222222222222"
262 -- Testing ftruncate() with file opening using a+t mode --
263 -- Testing ftruncate(): truncate to smaller size and display the file content --
266 File content after truncating file to 15 size : string(15) "222222222222222"
271 -- Testing ftruncate() with file having data of type text_with_new_line --
272 -- Testing ftruncate() with file opening using r mode --
273 -- Testing ftruncate(): truncate to smaller size and display the file content --
279 -- Testing ftruncate() with file opening using rb mode --
280 -- Testing ftruncate(): truncate to smaller size and display the file content --
286 -- Testing ftruncate() with file opening using rt mode --
287 -- Testing ftruncate(): truncate to smaller size and display the file content --
293 -- Testing ftruncate() with file opening using r+ mode --
294 -- Testing ftruncate(): truncate to smaller size and display the file content --
297 File content after truncating file to 15 size : string(15) "line
302 -- Testing ftruncate() with file opening using r+b mode --
303 -- Testing ftruncate(): truncate to smaller size and display the file content --
306 File content after truncating file to 15 size : string(15) "line
311 -- Testing ftruncate() with file opening using r+t mode --
312 -- Testing ftruncate(): truncate to smaller size and display the file content --
315 File content after truncating file to 15 size : string(15) "line
320 -- Testing ftruncate() with file opening using w mode --
321 -- Testing ftruncate(): truncate to smaller size and display the file content --
324 File content after truncating file to 15 size : string(15) "line
329 -- Testing ftruncate() with file opening using wb mode --
330 -- Testing ftruncate(): truncate to smaller size and display the file content --
333 File content after truncating file to 15 size : string(15) "line
338 -- Testing ftruncate() with file opening using wt mode --
339 -- Testing ftruncate(): truncate to smaller size and display the file content --
342 File content after truncating file to 15 size : string(15) "line
347 -- Testing ftruncate() with file opening using w+ mode --
348 -- Testing ftruncate(): truncate to smaller size and display the file content --
351 File content after truncating file to 15 size : string(15) "line
356 -- Testing ftruncate() with file opening using w+b mode --
357 -- Testing ftruncate(): truncate to smaller size and display the file content --
360 File content after truncating file to 15 size : string(15) "line
365 -- Testing ftruncate() with file opening using w+t mode --
366 -- Testing ftruncate(): truncate to smaller size and display the file content --
369 File content after truncating file to 15 size : string(15) "line
374 -- Testing ftruncate() with file opening using x mode --
375 -- Testing ftruncate(): truncate to smaller size and display the file content --
378 File content after truncating file to 15 size : string(15) "line
383 -- Testing ftruncate() with file opening using xb mode --
384 -- Testing ftruncate(): truncate to smaller size and display the file content --
387 File content after truncating file to 15 size : string(15) "line
392 -- Testing ftruncate() with file opening using xt mode --
393 -- Testing ftruncate(): truncate to smaller size and display the file content --
396 File content after truncating file to 15 size : string(15) "line
401 -- Testing ftruncate() with file opening using x+ mode --
402 -- Testing ftruncate(): truncate to smaller size and display the file content --
405 File content after truncating file to 15 size : string(15) "line
410 -- Testing ftruncate() with file opening using x+b mode --
411 -- Testing ftruncate(): truncate to smaller size and display the file content --
414 File content after truncating file to 15 size : string(15) "line
419 -- Testing ftruncate() with file opening using x+t mode --
420 -- Testing ftruncate(): truncate to smaller size and display the file content --
423 File content after truncating file to 15 size : string(15) "line
428 -- Testing ftruncate() with file opening using a mode --
429 -- Testing ftruncate(): truncate to smaller size and display the file content --
432 File content after truncating file to 15 size : string(15) "line
437 -- Testing ftruncate() with file opening using ab mode --
438 -- Testing ftruncate(): truncate to smaller size and display the file content --
441 File content after truncating file to 15 size : string(15) "line
446 -- Testing ftruncate() with file opening using at mode --
447 -- Testing ftruncate(): truncate to smaller size and display the file content --
450 File content after truncating file to 15 size : string(15) "line
455 -- Testing ftruncate() with file opening using a+ mode --
456 -- Testing ftruncate(): truncate to smaller size and display the file content --
459 File content after truncating file to 15 size : string(15) "line
464 -- Testing ftruncate() with file opening using a+b mode --
465 -- Testing ftruncate(): truncate to smaller size and display the file content --
468 File content after truncating file to 15 size : string(15) "line
473 -- Testing ftruncate() with file opening using a+t mode --
474 -- Testing ftruncate(): truncate to smaller size and display the file content --
477 File content after truncating file to 15 size : string(15) "line