Method Stdio.File()->create()


Method create

Stdio.File Stdio.File()
Stdio.File Stdio.File(string filename)
Stdio.File Stdio.File(string filename, string mode)
Stdio.File Stdio.File(string filename, string mode, int mask)
Stdio.File Stdio.File(string descriptorname)
Stdio.File Stdio.File(int fd)
Stdio.File Stdio.File(int fd, string mode)

Description

There are four basic ways to create a Stdio.File object. The first is calling it without any arguments, in which case the you'd have to call open(), connect() or some other method which connects the File object with a stream.

The second way is calling it with a filename and open mode. This is the same thing as cloning and then calling open(), except shorter and faster.

The third way is to call it with descriptorname of "stdin", "stdout" or "stderr". This will open the specified standard stream.

For the advanced users, you can use the file descriptors of the systems (note: emulated by pike on some systems - like NT). This is only useful for streaming purposes on unix systems. This is not recommended at all if you don't know what you're into. Default mode for this is "rw".

Note

Open mode will be filtered through the system UMASK. You might need to use chmod() later.

See also

open(), connect(), Stdio.FILE,