PHP Classes
Icontem

File: examples_file.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sven Wagener  >  File class  >  examples_file.php  
File: examples_file.php
Role: Example script
Content type: text/plain
Description: Example script for file class
Class: File class
File manipulation and form upload handling
 

Contents

Class file image Download
<?
/********************************************
*
*   Examples for file handling class
*
*/

include("file.class.php"); // Including file class

// $file=new file("test.swf",true); // Creating an instace of class for binary files
$file=new file("test.txt"); // Creating an instace of class

/***
* Debug mode:
*
* If debug mode is switched on, the script will stop at each error and the error will be printed out to screen
*/
$file->debug_mode(); // Switching on debug mode


// Geting file pointer and printing out
echo $file->pointer_get();

// Setting file pointer to 5
$file->pointer_set(5);

// Writing data to file on actual pointer position
$file->write("my text");

// Copying file
echo $file->copy("test.txt");

// Getting file name and printing out
echo $file->get_name();

// Getting file size and printing out
echo $file->get_size();

// Getting owner id of file and printing out
echo $file->get_owner_id();

// Getting group id of file and printing out
echo $file->get_group_id();

// Getting suffix of file and printing out
echo $file->get_suffix();

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products