Annotation of embedaddon/php/ext/standard/tests/file/fgetcsv_variation10.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test fgetcsv() : usage variations - file pointer pointing to EOF
3: --FILE--
4: <?php
5: /*
6: Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
7: Description: Gets line from file pointer and parse for CSV fields
8: */
9:
10: /* Testing fgetcsv() by reading from a file when the file pointer is pointing to end of file */
11:
12: echo "*** Testing fgetcsv() : with file pointer pointing to EOF ***\n";
13:
14: /* the array is with three elements in it. Each element should be read as
15: 1st element is delimiter, 2nd element is enclosure
16: and 3rd element is csv fields
17: */
18: $csv_lists = array (
19: array(',', '"', '"water",fruit'),
20: array(',', '"', '"water","fruit"'),
21: array(' ', '^', '^water^ ^fruit^'),
22: array(':', '&', '&water&:&fruit&'),
23: array('=', '=', '=water===fruit='),
24: array('-', '-', '-water--fruit-air'),
25: array('-', '-', '-water---fruit---air-'),
26: array(':', '&', '&""""&:&"&:,:":&,&:,,,,')
27: );
28:
29: $filename = dirname(__FILE__) . '/fgetcsv_variation10.tmp';
30: @unlink($filename);
31:
32: $file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t",
33: "a+", "a+b", "a+t",
34: "w+", "w+b", "w+t",
35: "x+", "x+b", "x+t");
36:
37: $loop_counter = 1;
38: foreach ($csv_lists as $csv_list) {
39: for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
40: // create the file and add the content with has csv fields
41: if ( strstr($file_modes[$mode_counter], "r") ) {
42: $file_handle = fopen($filename, "w");
43: } else {
44: $file_handle = fopen($filename, $file_modes[$mode_counter] );
45: }
46: if ( !$file_handle ) {
47: echo "Error: failed to create file $filename!\n";
48: exit();
49: }
50: $delimiter = $csv_list[0];
51: $enclosure = $csv_list[1];
52: $csv_field = $csv_list[2];
53: fwrite($file_handle, $csv_field . "\n");
54: // write another line of text and a blank line
55: // this will be used to test, if the fgetcsv() read more than a line and its
56: // working when only a blank line is read
57: fwrite($file_handle, "This is line of text without csv fields\n");
58: fwrite($file_handle, "\n"); // blank line
59:
60: // close the file if the mode to be used is read mode and re-open using read mode
1.1.1.2 ! misho 61: // else rewind the file pointer to beginning of the file
1.1 misho 62: if ( strstr($file_modes[$mode_counter], "r" ) ) {
63: fclose($file_handle);
64: $file_handle = fopen($filename, $file_modes[$mode_counter]);
65: }
66: echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n";
67:
68: // set the file pointer to EOF
69: var_dump( fseek($file_handle, 0, SEEK_END) );
70:
71: // call fgetcsv() to parse csv fields
72:
73: // now file pointer should point to end of the file, try reading again
74: var_dump( feof($file_handle) );
75: var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) );
76: // check the file pointer position and if eof
77: var_dump( ftell($file_handle) );
78: var_dump( feof($file_handle) );
79: var_dump( fgetcsv($file_handle) ); // with default args
80: // check the file pointer position and if eof
81: var_dump( ftell($file_handle) );
82: var_dump( feof($file_handle) );
83:
84: // close the file
85: fclose($file_handle);
86: //delete file
87: unlink($filename);
88: } //end of mode loop
89: } // end of foreach
90:
91: echo "Done\n";
92: ?>
93: --EXPECTF--
94: *** Testing fgetcsv() : with file pointer pointing to EOF ***
95:
96: -- Testing fgetcsv() with file opened using r mode --
97: int(0)
98: bool(false)
99: bool(false)
100: int(55)
101: bool(true)
102: bool(false)
103: int(55)
104: bool(true)
105:
106: -- Testing fgetcsv() with file opened using rb mode --
107: int(0)
108: bool(false)
109: bool(false)
110: int(55)
111: bool(true)
112: bool(false)
113: int(55)
114: bool(true)
115:
116: -- Testing fgetcsv() with file opened using rt mode --
117: int(0)
118: bool(false)
119: bool(false)
120: int(%d)
121: bool(true)
122: bool(false)
123: int(%d)
124: bool(true)
125:
126: -- Testing fgetcsv() with file opened using r+ mode --
127: int(0)
128: bool(false)
129: bool(false)
130: int(55)
131: bool(true)
132: bool(false)
133: int(55)
134: bool(true)
135:
136: -- Testing fgetcsv() with file opened using r+b mode --
137: int(0)
138: bool(false)
139: bool(false)
140: int(55)
141: bool(true)
142: bool(false)
143: int(55)
144: bool(true)
145:
146: -- Testing fgetcsv() with file opened using r+t mode --
147: int(0)
148: bool(false)
149: bool(false)
150: int(%d)
151: bool(true)
152: bool(false)
153: int(%d)
154: bool(true)
155:
156: -- Testing fgetcsv() with file opened using a+ mode --
157: int(0)
158: bool(false)
159: bool(false)
160: int(55)
161: bool(true)
162: bool(false)
163: int(55)
164: bool(true)
165:
166: -- Testing fgetcsv() with file opened using a+b mode --
167: int(0)
168: bool(false)
169: bool(false)
170: int(55)
171: bool(true)
172: bool(false)
173: int(55)
174: bool(true)
175:
176: -- Testing fgetcsv() with file opened using a+t mode --
177: int(0)
178: bool(false)
179: bool(false)
180: int(%d)
181: bool(true)
182: bool(false)
183: int(%d)
184: bool(true)
185:
186: -- Testing fgetcsv() with file opened using w+ mode --
187: int(0)
188: bool(false)
189: bool(false)
190: int(55)
191: bool(true)
192: bool(false)
193: int(55)
194: bool(true)
195:
196: -- Testing fgetcsv() with file opened using w+b mode --
197: int(0)
198: bool(false)
199: bool(false)
200: int(55)
201: bool(true)
202: bool(false)
203: int(55)
204: bool(true)
205:
206: -- Testing fgetcsv() with file opened using w+t mode --
207: int(0)
208: bool(false)
209: bool(false)
210: int(%d)
211: bool(true)
212: bool(false)
213: int(%d)
214: bool(true)
215:
216: -- Testing fgetcsv() with file opened using x+ mode --
217: int(0)
218: bool(false)
219: bool(false)
220: int(55)
221: bool(true)
222: bool(false)
223: int(55)
224: bool(true)
225:
226: -- Testing fgetcsv() with file opened using x+b mode --
227: int(0)
228: bool(false)
229: bool(false)
230: int(55)
231: bool(true)
232: bool(false)
233: int(55)
234: bool(true)
235:
236: -- Testing fgetcsv() with file opened using x+t mode --
237: int(0)
238: bool(false)
239: bool(false)
240: int(%d)
241: bool(true)
242: bool(false)
243: int(%d)
244: bool(true)
245:
246: -- Testing fgetcsv() with file opened using r mode --
247: int(0)
248: bool(false)
249: bool(false)
250: int(57)
251: bool(true)
252: bool(false)
253: int(57)
254: bool(true)
255:
256: -- Testing fgetcsv() with file opened using rb mode --
257: int(0)
258: bool(false)
259: bool(false)
260: int(57)
261: bool(true)
262: bool(false)
263: int(57)
264: bool(true)
265:
266: -- Testing fgetcsv() with file opened using rt mode --
267: int(0)
268: bool(false)
269: bool(false)
270: int(%d)
271: bool(true)
272: bool(false)
273: int(%d)
274: bool(true)
275:
276: -- Testing fgetcsv() with file opened using r+ mode --
277: int(0)
278: bool(false)
279: bool(false)
280: int(57)
281: bool(true)
282: bool(false)
283: int(57)
284: bool(true)
285:
286: -- Testing fgetcsv() with file opened using r+b mode --
287: int(0)
288: bool(false)
289: bool(false)
290: int(57)
291: bool(true)
292: bool(false)
293: int(57)
294: bool(true)
295:
296: -- Testing fgetcsv() with file opened using r+t mode --
297: int(0)
298: bool(false)
299: bool(false)
300: int(%d)
301: bool(true)
302: bool(false)
303: int(%d)
304: bool(true)
305:
306: -- Testing fgetcsv() with file opened using a+ mode --
307: int(0)
308: bool(false)
309: bool(false)
310: int(57)
311: bool(true)
312: bool(false)
313: int(57)
314: bool(true)
315:
316: -- Testing fgetcsv() with file opened using a+b mode --
317: int(0)
318: bool(false)
319: bool(false)
320: int(57)
321: bool(true)
322: bool(false)
323: int(57)
324: bool(true)
325:
326: -- Testing fgetcsv() with file opened using a+t mode --
327: int(0)
328: bool(false)
329: bool(false)
330: int(%d)
331: bool(true)
332: bool(false)
333: int(%d)
334: bool(true)
335:
336: -- Testing fgetcsv() with file opened using w+ mode --
337: int(0)
338: bool(false)
339: bool(false)
340: int(57)
341: bool(true)
342: bool(false)
343: int(57)
344: bool(true)
345:
346: -- Testing fgetcsv() with file opened using w+b mode --
347: int(0)
348: bool(false)
349: bool(false)
350: int(57)
351: bool(true)
352: bool(false)
353: int(57)
354: bool(true)
355:
356: -- Testing fgetcsv() with file opened using w+t mode --
357: int(0)
358: bool(false)
359: bool(false)
360: int(%d)
361: bool(true)
362: bool(false)
363: int(%d)
364: bool(true)
365:
366: -- Testing fgetcsv() with file opened using x+ mode --
367: int(0)
368: bool(false)
369: bool(false)
370: int(57)
371: bool(true)
372: bool(false)
373: int(57)
374: bool(true)
375:
376: -- Testing fgetcsv() with file opened using x+b mode --
377: int(0)
378: bool(false)
379: bool(false)
380: int(57)
381: bool(true)
382: bool(false)
383: int(57)
384: bool(true)
385:
386: -- Testing fgetcsv() with file opened using x+t mode --
387: int(0)
388: bool(false)
389: bool(false)
390: int(%d)
391: bool(true)
392: bool(false)
393: int(%d)
394: bool(true)
395:
396: -- Testing fgetcsv() with file opened using r mode --
397: int(0)
398: bool(false)
399: bool(false)
400: int(57)
401: bool(true)
402: bool(false)
403: int(57)
404: bool(true)
405:
406: -- Testing fgetcsv() with file opened using rb mode --
407: int(0)
408: bool(false)
409: bool(false)
410: int(57)
411: bool(true)
412: bool(false)
413: int(57)
414: bool(true)
415:
416: -- Testing fgetcsv() with file opened using rt mode --
417: int(0)
418: bool(false)
419: bool(false)
420: int(%d)
421: bool(true)
422: bool(false)
423: int(%d)
424: bool(true)
425:
426: -- Testing fgetcsv() with file opened using r+ mode --
427: int(0)
428: bool(false)
429: bool(false)
430: int(57)
431: bool(true)
432: bool(false)
433: int(57)
434: bool(true)
435:
436: -- Testing fgetcsv() with file opened using r+b mode --
437: int(0)
438: bool(false)
439: bool(false)
440: int(57)
441: bool(true)
442: bool(false)
443: int(57)
444: bool(true)
445:
446: -- Testing fgetcsv() with file opened using r+t mode --
447: int(0)
448: bool(false)
449: bool(false)
450: int(%d)
451: bool(true)
452: bool(false)
453: int(%d)
454: bool(true)
455:
456: -- Testing fgetcsv() with file opened using a+ mode --
457: int(0)
458: bool(false)
459: bool(false)
460: int(57)
461: bool(true)
462: bool(false)
463: int(57)
464: bool(true)
465:
466: -- Testing fgetcsv() with file opened using a+b mode --
467: int(0)
468: bool(false)
469: bool(false)
470: int(57)
471: bool(true)
472: bool(false)
473: int(57)
474: bool(true)
475:
476: -- Testing fgetcsv() with file opened using a+t mode --
477: int(0)
478: bool(false)
479: bool(false)
480: int(%d)
481: bool(true)
482: bool(false)
483: int(%d)
484: bool(true)
485:
486: -- Testing fgetcsv() with file opened using w+ mode --
487: int(0)
488: bool(false)
489: bool(false)
490: int(57)
491: bool(true)
492: bool(false)
493: int(57)
494: bool(true)
495:
496: -- Testing fgetcsv() with file opened using w+b mode --
497: int(0)
498: bool(false)
499: bool(false)
500: int(57)
501: bool(true)
502: bool(false)
503: int(57)
504: bool(true)
505:
506: -- Testing fgetcsv() with file opened using w+t mode --
507: int(0)
508: bool(false)
509: bool(false)
510: int(%d)
511: bool(true)
512: bool(false)
513: int(%d)
514: bool(true)
515:
516: -- Testing fgetcsv() with file opened using x+ mode --
517: int(0)
518: bool(false)
519: bool(false)
520: int(57)
521: bool(true)
522: bool(false)
523: int(57)
524: bool(true)
525:
526: -- Testing fgetcsv() with file opened using x+b mode --
527: int(0)
528: bool(false)
529: bool(false)
530: int(57)
531: bool(true)
532: bool(false)
533: int(57)
534: bool(true)
535:
536: -- Testing fgetcsv() with file opened using x+t mode --
537: int(0)
538: bool(false)
539: bool(false)
540: int(%d)
541: bool(true)
542: bool(false)
543: int(%d)
544: bool(true)
545:
546: -- Testing fgetcsv() with file opened using r mode --
547: int(0)
548: bool(false)
549: bool(false)
550: int(57)
551: bool(true)
552: bool(false)
553: int(57)
554: bool(true)
555:
556: -- Testing fgetcsv() with file opened using rb mode --
557: int(0)
558: bool(false)
559: bool(false)
560: int(57)
561: bool(true)
562: bool(false)
563: int(57)
564: bool(true)
565:
566: -- Testing fgetcsv() with file opened using rt mode --
567: int(0)
568: bool(false)
569: bool(false)
570: int(%d)
571: bool(true)
572: bool(false)
573: int(%d)
574: bool(true)
575:
576: -- Testing fgetcsv() with file opened using r+ mode --
577: int(0)
578: bool(false)
579: bool(false)
580: int(57)
581: bool(true)
582: bool(false)
583: int(57)
584: bool(true)
585:
586: -- Testing fgetcsv() with file opened using r+b mode --
587: int(0)
588: bool(false)
589: bool(false)
590: int(57)
591: bool(true)
592: bool(false)
593: int(57)
594: bool(true)
595:
596: -- Testing fgetcsv() with file opened using r+t mode --
597: int(0)
598: bool(false)
599: bool(false)
600: int(%d)
601: bool(true)
602: bool(false)
603: int(%d)
604: bool(true)
605:
606: -- Testing fgetcsv() with file opened using a+ mode --
607: int(0)
608: bool(false)
609: bool(false)
610: int(57)
611: bool(true)
612: bool(false)
613: int(57)
614: bool(true)
615:
616: -- Testing fgetcsv() with file opened using a+b mode --
617: int(0)
618: bool(false)
619: bool(false)
620: int(57)
621: bool(true)
622: bool(false)
623: int(57)
624: bool(true)
625:
626: -- Testing fgetcsv() with file opened using a+t mode --
627: int(0)
628: bool(false)
629: bool(false)
630: int(%d)
631: bool(true)
632: bool(false)
633: int(%d)
634: bool(true)
635:
636: -- Testing fgetcsv() with file opened using w+ mode --
637: int(0)
638: bool(false)
639: bool(false)
640: int(57)
641: bool(true)
642: bool(false)
643: int(57)
644: bool(true)
645:
646: -- Testing fgetcsv() with file opened using w+b mode --
647: int(0)
648: bool(false)
649: bool(false)
650: int(57)
651: bool(true)
652: bool(false)
653: int(57)
654: bool(true)
655:
656: -- Testing fgetcsv() with file opened using w+t mode --
657: int(0)
658: bool(false)
659: bool(false)
660: int(%d)
661: bool(true)
662: bool(false)
663: int(%d)
664: bool(true)
665:
666: -- Testing fgetcsv() with file opened using x+ mode --
667: int(0)
668: bool(false)
669: bool(false)
670: int(57)
671: bool(true)
672: bool(false)
673: int(57)
674: bool(true)
675:
676: -- Testing fgetcsv() with file opened using x+b mode --
677: int(0)
678: bool(false)
679: bool(false)
680: int(57)
681: bool(true)
682: bool(false)
683: int(57)
684: bool(true)
685:
686: -- Testing fgetcsv() with file opened using x+t mode --
687: int(0)
688: bool(false)
689: bool(false)
690: int(%d)
691: bool(true)
692: bool(false)
693: int(%d)
694: bool(true)
695:
696: -- Testing fgetcsv() with file opened using r mode --
697: int(0)
698: bool(false)
699: bool(false)
700: int(57)
701: bool(true)
702: bool(false)
703: int(57)
704: bool(true)
705:
706: -- Testing fgetcsv() with file opened using rb mode --
707: int(0)
708: bool(false)
709: bool(false)
710: int(57)
711: bool(true)
712: bool(false)
713: int(57)
714: bool(true)
715:
716: -- Testing fgetcsv() with file opened using rt mode --
717: int(0)
718: bool(false)
719: bool(false)
720: int(%d)
721: bool(true)
722: bool(false)
723: int(%d)
724: bool(true)
725:
726: -- Testing fgetcsv() with file opened using r+ mode --
727: int(0)
728: bool(false)
729: bool(false)
730: int(57)
731: bool(true)
732: bool(false)
733: int(57)
734: bool(true)
735:
736: -- Testing fgetcsv() with file opened using r+b mode --
737: int(0)
738: bool(false)
739: bool(false)
740: int(57)
741: bool(true)
742: bool(false)
743: int(57)
744: bool(true)
745:
746: -- Testing fgetcsv() with file opened using r+t mode --
747: int(0)
748: bool(false)
749: bool(false)
750: int(%d)
751: bool(true)
752: bool(false)
753: int(%d)
754: bool(true)
755:
756: -- Testing fgetcsv() with file opened using a+ mode --
757: int(0)
758: bool(false)
759: bool(false)
760: int(57)
761: bool(true)
762: bool(false)
763: int(57)
764: bool(true)
765:
766: -- Testing fgetcsv() with file opened using a+b mode --
767: int(0)
768: bool(false)
769: bool(false)
770: int(57)
771: bool(true)
772: bool(false)
773: int(57)
774: bool(true)
775:
776: -- Testing fgetcsv() with file opened using a+t mode --
777: int(0)
778: bool(false)
779: bool(false)
780: int(%d)
781: bool(true)
782: bool(false)
783: int(%d)
784: bool(true)
785:
786: -- Testing fgetcsv() with file opened using w+ mode --
787: int(0)
788: bool(false)
789: bool(false)
790: int(57)
791: bool(true)
792: bool(false)
793: int(57)
794: bool(true)
795:
796: -- Testing fgetcsv() with file opened using w+b mode --
797: int(0)
798: bool(false)
799: bool(false)
800: int(57)
801: bool(true)
802: bool(false)
803: int(57)
804: bool(true)
805:
806: -- Testing fgetcsv() with file opened using w+t mode --
807: int(0)
808: bool(false)
809: bool(false)
810: int(%d)
811: bool(true)
812: bool(false)
813: int(%d)
814: bool(true)
815:
816: -- Testing fgetcsv() with file opened using x+ mode --
817: int(0)
818: bool(false)
819: bool(false)
820: int(57)
821: bool(true)
822: bool(false)
823: int(57)
824: bool(true)
825:
826: -- Testing fgetcsv() with file opened using x+b mode --
827: int(0)
828: bool(false)
829: bool(false)
830: int(57)
831: bool(true)
832: bool(false)
833: int(57)
834: bool(true)
835:
836: -- Testing fgetcsv() with file opened using x+t mode --
837: int(0)
838: bool(false)
839: bool(false)
840: int(%d)
841: bool(true)
842: bool(false)
843: int(%d)
844: bool(true)
845:
846: -- Testing fgetcsv() with file opened using r mode --
847: int(0)
848: bool(false)
849: bool(false)
850: int(59)
851: bool(true)
852: bool(false)
853: int(59)
854: bool(true)
855:
856: -- Testing fgetcsv() with file opened using rb mode --
857: int(0)
858: bool(false)
859: bool(false)
860: int(59)
861: bool(true)
862: bool(false)
863: int(59)
864: bool(true)
865:
866: -- Testing fgetcsv() with file opened using rt mode --
867: int(0)
868: bool(false)
869: bool(false)
870: int(%d)
871: bool(true)
872: bool(false)
873: int(%d)
874: bool(true)
875:
876: -- Testing fgetcsv() with file opened using r+ mode --
877: int(0)
878: bool(false)
879: bool(false)
880: int(59)
881: bool(true)
882: bool(false)
883: int(59)
884: bool(true)
885:
886: -- Testing fgetcsv() with file opened using r+b mode --
887: int(0)
888: bool(false)
889: bool(false)
890: int(59)
891: bool(true)
892: bool(false)
893: int(59)
894: bool(true)
895:
896: -- Testing fgetcsv() with file opened using r+t mode --
897: int(0)
898: bool(false)
899: bool(false)
900: int(%d)
901: bool(true)
902: bool(false)
903: int(%d)
904: bool(true)
905:
906: -- Testing fgetcsv() with file opened using a+ mode --
907: int(0)
908: bool(false)
909: bool(false)
910: int(59)
911: bool(true)
912: bool(false)
913: int(59)
914: bool(true)
915:
916: -- Testing fgetcsv() with file opened using a+b mode --
917: int(0)
918: bool(false)
919: bool(false)
920: int(59)
921: bool(true)
922: bool(false)
923: int(59)
924: bool(true)
925:
926: -- Testing fgetcsv() with file opened using a+t mode --
927: int(0)
928: bool(false)
929: bool(false)
930: int(%d)
931: bool(true)
932: bool(false)
933: int(%d)
934: bool(true)
935:
936: -- Testing fgetcsv() with file opened using w+ mode --
937: int(0)
938: bool(false)
939: bool(false)
940: int(59)
941: bool(true)
942: bool(false)
943: int(59)
944: bool(true)
945:
946: -- Testing fgetcsv() with file opened using w+b mode --
947: int(0)
948: bool(false)
949: bool(false)
950: int(59)
951: bool(true)
952: bool(false)
953: int(59)
954: bool(true)
955:
956: -- Testing fgetcsv() with file opened using w+t mode --
957: int(0)
958: bool(false)
959: bool(false)
960: int(%d)
961: bool(true)
962: bool(false)
963: int(%d)
964: bool(true)
965:
966: -- Testing fgetcsv() with file opened using x+ mode --
967: int(0)
968: bool(false)
969: bool(false)
970: int(59)
971: bool(true)
972: bool(false)
973: int(59)
974: bool(true)
975:
976: -- Testing fgetcsv() with file opened using x+b mode --
977: int(0)
978: bool(false)
979: bool(false)
980: int(59)
981: bool(true)
982: bool(false)
983: int(59)
984: bool(true)
985:
986: -- Testing fgetcsv() with file opened using x+t mode --
987: int(0)
988: bool(false)
989: bool(false)
990: int(%d)
991: bool(true)
992: bool(false)
993: int(%d)
994: bool(true)
995:
996: -- Testing fgetcsv() with file opened using r mode --
997: int(0)
998: bool(false)
999: bool(false)
1000: int(63)
1001: bool(true)
1002: bool(false)
1003: int(63)
1004: bool(true)
1005:
1006: -- Testing fgetcsv() with file opened using rb mode --
1007: int(0)
1008: bool(false)
1009: bool(false)
1010: int(63)
1011: bool(true)
1012: bool(false)
1013: int(63)
1014: bool(true)
1015:
1016: -- Testing fgetcsv() with file opened using rt mode --
1017: int(0)
1018: bool(false)
1019: bool(false)
1020: int(%d)
1021: bool(true)
1022: bool(false)
1023: int(%d)
1024: bool(true)
1025:
1026: -- Testing fgetcsv() with file opened using r+ mode --
1027: int(0)
1028: bool(false)
1029: bool(false)
1030: int(63)
1031: bool(true)
1032: bool(false)
1033: int(63)
1034: bool(true)
1035:
1036: -- Testing fgetcsv() with file opened using r+b mode --
1037: int(0)
1038: bool(false)
1039: bool(false)
1040: int(63)
1041: bool(true)
1042: bool(false)
1043: int(63)
1044: bool(true)
1045:
1046: -- Testing fgetcsv() with file opened using r+t mode --
1047: int(0)
1048: bool(false)
1049: bool(false)
1050: int(%d)
1051: bool(true)
1052: bool(false)
1053: int(%d)
1054: bool(true)
1055:
1056: -- Testing fgetcsv() with file opened using a+ mode --
1057: int(0)
1058: bool(false)
1059: bool(false)
1060: int(63)
1061: bool(true)
1062: bool(false)
1063: int(63)
1064: bool(true)
1065:
1066: -- Testing fgetcsv() with file opened using a+b mode --
1067: int(0)
1068: bool(false)
1069: bool(false)
1070: int(63)
1071: bool(true)
1072: bool(false)
1073: int(63)
1074: bool(true)
1075:
1076: -- Testing fgetcsv() with file opened using a+t mode --
1077: int(0)
1078: bool(false)
1079: bool(false)
1080: int(%d)
1081: bool(true)
1082: bool(false)
1083: int(%d)
1084: bool(true)
1085:
1086: -- Testing fgetcsv() with file opened using w+ mode --
1087: int(0)
1088: bool(false)
1089: bool(false)
1090: int(63)
1091: bool(true)
1092: bool(false)
1093: int(63)
1094: bool(true)
1095:
1096: -- Testing fgetcsv() with file opened using w+b mode --
1097: int(0)
1098: bool(false)
1099: bool(false)
1100: int(63)
1101: bool(true)
1102: bool(false)
1103: int(63)
1104: bool(true)
1105:
1106: -- Testing fgetcsv() with file opened using w+t mode --
1107: int(0)
1108: bool(false)
1109: bool(false)
1110: int(%d)
1111: bool(true)
1112: bool(false)
1113: int(%d)
1114: bool(true)
1115:
1116: -- Testing fgetcsv() with file opened using x+ mode --
1117: int(0)
1118: bool(false)
1119: bool(false)
1120: int(63)
1121: bool(true)
1122: bool(false)
1123: int(63)
1124: bool(true)
1125:
1126: -- Testing fgetcsv() with file opened using x+b mode --
1127: int(0)
1128: bool(false)
1129: bool(false)
1130: int(63)
1131: bool(true)
1132: bool(false)
1133: int(63)
1134: bool(true)
1135:
1136: -- Testing fgetcsv() with file opened using x+t mode --
1137: int(0)
1138: bool(false)
1139: bool(false)
1140: int(%d)
1141: bool(true)
1142: bool(false)
1143: int(%d)
1144: bool(true)
1145:
1146: -- Testing fgetcsv() with file opened using r mode --
1147: int(0)
1148: bool(false)
1149: bool(false)
1150: int(65)
1151: bool(true)
1152: bool(false)
1153: int(65)
1154: bool(true)
1155:
1156: -- Testing fgetcsv() with file opened using rb mode --
1157: int(0)
1158: bool(false)
1159: bool(false)
1160: int(65)
1161: bool(true)
1162: bool(false)
1163: int(65)
1164: bool(true)
1165:
1166: -- Testing fgetcsv() with file opened using rt mode --
1167: int(0)
1168: bool(false)
1169: bool(false)
1170: int(%d)
1171: bool(true)
1172: bool(false)
1173: int(%d)
1174: bool(true)
1175:
1176: -- Testing fgetcsv() with file opened using r+ mode --
1177: int(0)
1178: bool(false)
1179: bool(false)
1180: int(65)
1181: bool(true)
1182: bool(false)
1183: int(65)
1184: bool(true)
1185:
1186: -- Testing fgetcsv() with file opened using r+b mode --
1187: int(0)
1188: bool(false)
1189: bool(false)
1190: int(65)
1191: bool(true)
1192: bool(false)
1193: int(65)
1194: bool(true)
1195:
1196: -- Testing fgetcsv() with file opened using r+t mode --
1197: int(0)
1198: bool(false)
1199: bool(false)
1200: int(%d)
1201: bool(true)
1202: bool(false)
1203: int(%d)
1204: bool(true)
1205:
1206: -- Testing fgetcsv() with file opened using a+ mode --
1207: int(0)
1208: bool(false)
1209: bool(false)
1210: int(65)
1211: bool(true)
1212: bool(false)
1213: int(65)
1214: bool(true)
1215:
1216: -- Testing fgetcsv() with file opened using a+b mode --
1217: int(0)
1218: bool(false)
1219: bool(false)
1220: int(65)
1221: bool(true)
1222: bool(false)
1223: int(65)
1224: bool(true)
1225:
1226: -- Testing fgetcsv() with file opened using a+t mode --
1227: int(0)
1228: bool(false)
1229: bool(false)
1230: int(%d)
1231: bool(true)
1232: bool(false)
1233: int(%d)
1234: bool(true)
1235:
1236: -- Testing fgetcsv() with file opened using w+ mode --
1237: int(0)
1238: bool(false)
1239: bool(false)
1240: int(65)
1241: bool(true)
1242: bool(false)
1243: int(65)
1244: bool(true)
1245:
1246: -- Testing fgetcsv() with file opened using w+b mode --
1247: int(0)
1248: bool(false)
1249: bool(false)
1250: int(65)
1251: bool(true)
1252: bool(false)
1253: int(65)
1254: bool(true)
1255:
1256: -- Testing fgetcsv() with file opened using w+t mode --
1257: int(0)
1258: bool(false)
1259: bool(false)
1260: int(%d)
1261: bool(true)
1262: bool(false)
1263: int(%d)
1264: bool(true)
1265:
1266: -- Testing fgetcsv() with file opened using x+ mode --
1267: int(0)
1268: bool(false)
1269: bool(false)
1270: int(65)
1271: bool(true)
1272: bool(false)
1273: int(65)
1274: bool(true)
1275:
1276: -- Testing fgetcsv() with file opened using x+b mode --
1277: int(0)
1278: bool(false)
1279: bool(false)
1280: int(65)
1281: bool(true)
1282: bool(false)
1283: int(65)
1284: bool(true)
1285:
1286: -- Testing fgetcsv() with file opened using x+t mode --
1287: int(0)
1288: bool(false)
1289: bool(false)
1290: int(%d)
1291: bool(true)
1292: bool(false)
1293: int(%d)
1294: bool(true)
1295: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>