forked from extern/egroupware
309 lines
4.0 KiB
HTML
309 lines
4.0 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>File functions</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.52"><LINK
|
|
REL="HOME"
|
|
TITLE="phpGroupWare Docs V0.05"
|
|
HREF="book1.html"><LINK
|
|
REL="UP"
|
|
TITLE="The API"
|
|
HREF="devapi.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Application Functions"
|
|
HREF="x407.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Email/NNTP Functions"
|
|
HREF="x471.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>phpGroupWare Docs V0.05</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x407.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 25. The API</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x471.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="AEN434"
|
|
>File functions</A
|
|
></H1
|
|
><P
|
|
></P
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN437"
|
|
>$phpgw->vfs->read_file</A
|
|
></H2
|
|
><P
|
|
> <TT
|
|
CLASS="CLASSNAME"
|
|
>$phpgw->vfs->read_file($file)</TT
|
|
> Returns the data from
|
|
<TT
|
|
CLASS="CLASSNAME"
|
|
>$file</TT
|
|
>.
|
|
You must send the complete path to the file.
|
|
</P
|
|
><P
|
|
> Example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>$data = $phpgw->vfs->read_file("/some/dir/to/file.txt");</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN444"
|
|
>$phpgw->vfs->write_file</A
|
|
></H2
|
|
><P
|
|
> <TT
|
|
CLASS="CLASSNAME"
|
|
>$phpgw->vfs->write_file($file, $contents)</TT
|
|
>
|
|
Write data to <TT
|
|
CLASS="CLASSNAME"
|
|
>$file</TT
|
|
>.
|
|
You must send the complete path to the file.
|
|
</P
|
|
><P
|
|
> Example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>$data = $phpgw->vfs->write_file("/some/dir/to/file.txt");</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN451"
|
|
>$phpgw->vfs->read_userfile</A
|
|
></H2
|
|
><P
|
|
> <TT
|
|
CLASS="CLASSNAME"
|
|
>$phpgw->vfs->read_userfile($file)</TT
|
|
>
|
|
Returns the data from <TT
|
|
CLASS="CLASSNAME"
|
|
>$file</TT
|
|
>, which resides
|
|
in the users private dir.
|
|
</P
|
|
><P
|
|
> Example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>$data = $phpgw->vfs->read_userfile("file.txt");</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN458"
|
|
>$phpgw->vfs->write_userfile</A
|
|
></H2
|
|
><P
|
|
> <TT
|
|
CLASS="CLASSNAME"
|
|
>$phpgw->write_userfile($file, $contents)</TT
|
|
>
|
|
Writes data to <TT
|
|
CLASS="CLASSNAME"
|
|
>$file</TT
|
|
>, which resides in the
|
|
users private dir.
|
|
</P
|
|
><P
|
|
> Example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>$data = $phpgw->vfs->write_userfile("file.txt");</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN465"
|
|
>$phpgw->vfs->list_userfiles</A
|
|
></H2
|
|
><P
|
|
> <TT
|
|
CLASS="CLASSNAME"
|
|
>$phpgw->vfs->list_userfiles()</TT
|
|
>
|
|
Returns an array which has the list of files in the users private dir.
|
|
</P
|
|
><P
|
|
> Example:
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="PROGRAMLISTING"
|
|
>$filelist = array();
|
|
$filelist = $phpgw->vfs->list_userfiles();</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
>
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x407.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="book1.html"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x471.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Application Functions</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="devapi.html"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Email/NNTP Functions</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |