User Tools

Site Tools


uphp:functions:fopen

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:fopen [2017/04/05 14:10]
jeff
uphp:functions:fopen [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"><html><span style="font-size:125%;color:green">int +<well size="sm"><html> 
-<span style="color:black"></html>[[fopen]] +<span style="font-size:125%;color:green">int 
-<html>(+<span style="color:black">fopen (
 <span style="color:green">string <span style="color:green">string
 <span style="color:blue">$filename<span style="color:black">,  <span style="color:blue">$filename<span style="color:black">, 
Line 17: Line 17:
 </html></well> </html></well>
  
-Attempt to open a file or stream for reading or writing, and return the file handle for future operations+Attempt to open a file (or special streamfor reading or writing, and return the file handle for future operations
  
 ====Parameters==== ====Parameters====
Line 32: Line 32:
   * 'a' - Open the file in append mode for writing, which will open the file and move the pointer to the end of the file   * 'a' - Open the file in append mode for writing, which will open the file and move the pointer to the end of the file
  
-====Return Value====+====Return Values====
  
-Upon success it returns a file handle which may be used together with the other file functions that require a handle such as [[fgets()]], [[fwrite()]], [[fclose()]] and [[feof()]]+<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  File handle, or 0 if the attempt to open the file or stream fails
  
-If the attempt to open the file or stream fails it will return 0+The file handle may be used together with the other file functions that require a handle such as [[fgets()]], [[fwrite()]], [[fclose()]] and [[feof()]]
  
 ====Example==== ====Example====
Line 64: Line 64:
 [[fgets()]] - Return a single line from a file, stream or socket, with optional size limit [[fgets()]] - Return a single line from a file, stream or socket, with optional size limit
  
-[[fwrite()]] - Write data to a file or stream+[[fwrite()]] - Write data to a filestream or socket
  
 [[tar_put()]] - Add a file to an open file in TAR format [[tar_put()]] - Add a file to an open file in TAR format
- 
-[[fclose()]] - Close a file, stream or socket 
  
 [[feof()]] - Test if no more data is available in a file, stream or socket [[feof()]] - Test if no more data is available in a file, stream or socket
  
-[[filesize()]] - +[[filesize()]] - Return the size of a file, or the number of unread bytes in a stream or socket
  
 [[fseek()]] - Position the file pointer in an open file [[fseek()]] - Position the file pointer in an open file
Line 78: Line 76:
 [[ftell()]] - Return the current position of a file read/write pointer [[ftell()]] - Return the current position of a file read/write pointer
  
-[[chdir()]] - Change uPHP's current directory+[[fclose()]] - Close a file, stream or socket
  
uphp/functions/fopen.1491401436.txt.gz · Last modified: 2021/09/13 05:56 (external edit)