--TEST-- Test fgets() function : usage variations - seek n read --SKIPIF-- --FILE-- --EXPECT-- *** Testing fgets() : usage variations *** -- Testing fgets() with file opened using mode w+ -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode w+b -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode w+t -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode a+ -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode a+b -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode a+t -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode x+ -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode x+b -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) -- Testing fgets() with file opened using mode x+t -- -- File content type : numeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "222222222222222222222222222222222222222222222" int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "2222222222222222222" int(44) bool(false) -- File content type : text -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "text text text text text text text text text " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "text text text text" int(44) bool(false) -- File content type : text_with_new_line -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(13) "line of text " int(18) bool(false) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(11) "ne of text " int(36) bool(false) -- File content type : alphanumeric -- -- fgets() with location set by fseek() with default length -- int(0) int(5) string(45) "ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 ab12 " int(50) bool(true) -- fgets() with location set by fseek() with length = 20 -- int(0) int(25) string(19) "ab12 ab12 ab12 ab12" int(44) bool(false) Done