|
| ||||||||||
| Tags: database, directory scan, table scan |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Scan a directory or table in database
I have two opportunities to retrieve the file list: - Place all files in a folder, scan the file and exit the list. And it has the advantage of easily by following the addition of new files (you stick in the folder, and it's good). - Create a table that indexes all the files, then make a call out the basic list. A little more complicated to maintain thereafter, add an entry for each database file, etc. My question is mainly in terms of speed: do a scan of directory which will actually be heavier than a call basis, or equivalent? |
|
#2
| ||||
| ||||
| Re: Scan a directory or table in database
Yes, but if you stay in reasonable volumes of files, it will do. But by a database you simplify life later if you want to move the files elsewhere, or if you want to put in palc rights management |
|
#3
| |||
| |||
| Re: Scan a directory or table in database
For volume, we will type in 10 or 20 large files up. Especially if many visitors that it worries me. For moving, I just set the path of files in a file PHP constant and change it when it happens, right? But, it is true that a scan through the directory, rights management is impossible ... |
|
#4
| ||||
| ||||
| Re: Scan a directory or table in database
Around twenty files, it is strange. But as said above, it is preferable to use a file management via SQL, it will be much easier now, for instance if you want the future to implement a download counter. And if you really have a lot of visits and the reduction of a select query to your database would make him the greatest good, directs you to a little cache system |
|
#5
| |||
| |||
| Re: Scan a directory or table in database
If it is to scan your files, you've DirectoryIterator. The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories. DirectoryIterator Methods:
|
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Scan a directory or table in database" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to list all table containing SQlite database | Neil'o | Software Development | 4 | 24-02-2010 10:00 PM |
| Defining primary key on database table | Garlands | Software Development | 4 | 09-02-2010 08:09 PM |
| Actvie Directory Database Corruption >Event ID 467 > Index of table datatable is corrupted | PatrModer | Active Directory | 3 | 07-07-2009 08:51 PM |
| Check if database or table exists | Xan | Software Development | 2 | 29-05-2009 04:53 PM |
| Creating xml File from database table in VB.Net | Jateen | Software Development | 2 | 29-12-2008 05:20 PM |