User Tools

Site Tools


uphp:functions:file_exists

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:file_exists [2017/04/10 13:22]
jeff
uphp:functions:file_exists [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%;color:green">int <span style="font-size:125%;color:green">int
-<span style="color:black"> +<span style="color:black">file_exists (
-</html> +
-[[file_exists]] ( +
-<html>+
 <span style="color:green">string <span style="color:green">string
 <span style="color:blue">$filename <span style="color:blue">$filename
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 Return 1 (true) if the file exists, otherwise return 0 (false) Return 1 (true) if the file exists, otherwise return 0 (false)
Line 26: Line 21:
 <html><b><span style="color:blue">$filename<span style="color:black"></b></html>:  Full path and file name to check <html><b><span style="color:blue">$filename<span style="color:black"></b></html>:  Full path and file name to check
  
-====Return Value====+====Return Values====
  
 <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 if file exists, 0 if file does not exist <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 if file exists, 0 if file does not exist
Line 32: Line 27:
 ====Examples==== ====Examples====
  
-**Simple existence report:**+===Simple existence report===
  
 <code php> <code php>
Line 44: Line 39:
 </code> </code>
  
-**Create a new file with a unique non-conflicting filename** - this example is extracted from the Wattmon OS "/scripts/logrotate.cgi":+===Create a new file with a unique non-conflicting filename=== 
 + 
 +This example is extracted from the Wattmon OS "/scripts/logrotate.cgi":
  
 <code php> <code php>
Line 70: Line 67:
 [[findfirst()]] - Start searching the current folder for files matching a pattern and attributes [[findfirst()]] - Start searching the current folder for files matching a pattern and attributes
  
-[[strftime()]] - Format the passed time using the format <html><b><span style="color:green">string<span style="color:black"></b></html>+[[strftime()]] - Format a Linux Timestamp using format <html><b><span style="color:green">string</b></html>
  
 [[time()]] - Return the current system timestamp [[time()]] - Return the current system timestamp
  
-[[rename()]] - Rename or move a file from source to destination+[[rename()]] - Rename or move a file or directory from source to destination
  
-[[log()]] - Print to the System Log+[[log()]] - Print to the System Log (or optional file)
  
 [[uphp:uphp_special_variables]] - Special arrays that are populated automatically (including ''$_GLOBALS'') [[uphp:uphp_special_variables]] - Special arrays that are populated automatically (including ''$_GLOBALS'')
  
uphp/functions/file_exists.1491830535.txt.gz · Last modified: 2021/09/13 05:56 (external edit)