set FileSysObj = Server.CreateObject("Scripting.FileSystemObject")
fExists=FileSysObj.FileExists(filename)
set TextStreamObj = FileSysObj.OpenTextFile(filename,8,true)
This is command in Asp that can open text file. but in php can open file and other such as connection to port (i think)
Tee+