User Tools

Site Tools


uphp:functions:fgets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:fgets [2018/04/14 14:39]
jeff Hyperlinks to function 'strlen'
uphp:functions:fgets [2021/09/13 05:57] (current)
Line 20: Line 20:
 This function works with different resource types. If no size is specified, it will keep reading from the file, stream or socket until it reaches the end of the line (or the end of the file). For streams and sockets it will return characters until a line feed (LF) or carriage return (CR) is reached (it will wait until an entire line is received). If the optional size is specified and the line is longer than this size, the function will return only the number of characters specified. This function works with different resource types. If no size is specified, it will keep reading from the file, stream or socket until it reaches the end of the line (or the end of the file). For streams and sockets it will return characters until a line feed (LF) or carriage return (CR) is reached (it will wait until an entire line is received). If the optional size is specified and the line is longer than this size, the function will return only the number of characters specified.
  
-**Note:** The maximum length of a returned string in Wattmon is 254 bytes so when reading a longer input stream, you will need to check the string length using [[strlen()]] and if it is equal to 254 you would need to perform additional reads to ensure that a full line is read from the input stream.+**Note:** The maximum length of a returned string in [[hardware:wattmons|Wattmon]] is 254 bytes so when reading a longer input stream, you will need to check the string length using [[strlen()]] and if it is equal to 254 you would need to perform additional reads to ensure that a full line is read from the input stream.
  
 ====Parameters==== ====Parameters====
uphp/functions/fgets.1523716797.txt.gz · Last modified: 2021/09/13 05:56 (external edit)