Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

Online

� la maison Codes sources E-Livres T�l�chargements Nous contacter Au sujet de nous

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting


Dossier manipulant dans PHP

Previous Next





Il y a beaucoup de fonctions int�gr�es dans PHP pour manipuler des dossiers et des annuaires. En utilisant ces fonctions nous pouvons lire, �crire, supprimer, et obtenir un bon nombre d'information des dossiers. Pour ex�cuter n'importe quel funtion sur un dossier nous devrions avoir la bonne permission qui nous permettra au manupulate qui classent.


Cr�ant et supprimant un dossier

Nous pouvons cr�er un dossier en utilisant le funtion � contact () �. Le funtion de contact () une fois appel� premier recherche si le dossier indiqu� existe ou pas si le doesnot de dossier existe il cr�e un avec specfied le nom de fichier. Pour supprimer un dossier nous employons la fonction appel�e � d�tachons () �. Ce funtion enl�ve le dossier qui a �t� envoy� comme argument.

touch(�newinfo.txt�); //create a new file, if it doesn�t already exist
unlink(�oldinfo.txt�); //delete a file


Ouvrir le dossier existant

Quand est-ce qu'un dossier a obtenu cr��, comment lui acc�der ?
Nous pouvons acc�der � un dossier existant employant le funtion appel� � fopen () �. Ce funtion prend deux arguments, le premier argument indique le nom du dossier qui doit �tre ouvert, et le deuxi�me argument indique dans quel mode que le dossier doit �tre opened.i'e dans � lire-r �, � �crire-W � ou les deux mode � lecture/�criture �.

Si la fonction fopen () l'ex�cute avec succ�s alors renvoie une valeur de nombre entier connue sous le nom d'indicateur de dossier. Cette valeur devrait �tre stock�e dans une variable. Cette variable est employ�e pour fonctionner dessus avec le dossier ouvert. Si le funtion fopen () �choue l'ex�cution pour n'importe quelle raison, il des retours justes FAUX. Une fois que le dossier est employ� nous devrions le fermer employant la fonction de � fclose () �. Cette fonction prend seulement le nom de fichier comme argument.

$oldfp = fopen(�oldinfo.txt�, �r�); //opens a file for reading
if(!$fp = fopen(�newinfo.txt�, �w�)) //tries to open a file for writing
die(�Error on opening file!�); //terminates the execution of the script if it cannot open the file
fclose($oldfp);


Lecture � partir des dossiers

Pour lire � partir du dossier nous employons le funtion appel� les � fgets () �. Quand ce funtion s'appelle, il donne lecture tous caract�res jusqu'� un caract�re NL (\ n), ou extr�mit� du dossier (EOF), ou jusqu'� ce qu'une longueur indiqu�e soit atteinte.

La fonction � fgets () � est les � fgets semblables () �, � la diff�rence des fgets () qu'elle renvoie un caract�re simple � partir d'un dossier. il n'y a aucun besoin d'indiquer n'importe quelle longueur comme argument, puisqu'un caract�re est toujours de 1 byte.

$text = fgets($fp, 2000); //reads 2000 bytes at most
$chr = fgetc($fp); //reads 1 byte only


Plus de dossier manipulant des fonctions

Il y a beaucoup d'autres fonctions comme lesquelles vous pouvez employer avec des dossiers : l'essai fonctionne - des � file_exists () �, � is_file () �, � is_dir () �, � is_readable () �, � is_writeable () �, � is_executable () � ; fonctions qui l'information de retour sur des dossiers : � filesize () �, � fileatime () �, � filemtime () �, � filectime () �. Vous pouvez figurer dehors ce que la fonction fait par la lecture juste son nom.

La table suivante contient peu de dossier manipulant des fonctions et leur description

Example Description Preview
chdir Changes PHP's current directory to specified directory. Returns TRUE on success or FALSE on failure.  
chroot Change the root directory  
closedir Closes a directory handle previously opened with opendir(). 
copy Makes a copy of a file. Returns TRUE if the copy succeeded, FALSE otherwise.  
dir dir -- directory class class dir { dir(string directory); string path; resource handl... 
file Returns the contents of a file in an array. 
filesize Gets file size  
fopen Opens a file handle to be used . 
fread Reads the contents of a file descriptor assigned with fopen(). 
fwrite Writes to a file descriptor opened with fopen(). 
getcwd gets the current working directory string. getcwd (void) Returns the current working directory.  
opendir Returns a directory handle that can be used with readdir(), closedir() and rewinddir(). 
readdir Reads the next file from a directory handle opened with opendir(). 
rename Renames a file from the old file name to the new file name.  
rewinddir rewind directory handle, void rewinddir ( resource dir_handle) Resets the directory stream indicated by dir_handle to the beginning of the directory.  
scandir List files and directories inside the specified path  
Unlink Deletes a file. 




Previous Next

Keywords:php tutorial, php scripts, php nuke, php download, php editor, php mysql, php forum, php add link, learn php, php code


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizes
Oracle Quiz
MySQL Quiz
Operating System Quizes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizes
Testing Quiz
Firewalls Quiz
SAP Module Quizes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizes
Corba Quiz
Networking Quiz
Microsoft Office Quizes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizes
Financial Accounting Quiz
Managerial Accounting Quiz

Privacy Policy
Copyright � 2003-2025 Vyom Technosoft Pvt. Ltd., All Rights Reserved.