You are here: Re: recursive file search « PHP Programming Language « IT news, forums, messages
Re: recursive file search

Posted by pangea33 on 10/29/06 17:28

Robertico wrote:
> I'am new to php and have a question about a recursive file search.
> I'd like to do a recursive search for jpg-files and add the filenames (full
> path) to a mysql database.
> I appreciate any help !
>
> Regards,
>
> Robertico

I went ahead and wrote a couple different scripts to do this because I
found it an interesting topic. Yes recursive php directory searches can
do what you want, but they're too resource intensive when you're just
looking for filenames. You can accomplish this very fast using the
"find" shell command, as long as you can run "shell_exec()" in php.

http://www.ss64.com/bash/find.html
**************
SCRIPT OUTPUT:

There were a total of 889 jpg files found

Executed file search in 0.073278903961182 seconds
Generated SQL INSERT script with mysql_escape_string in
0.19165515899658 seconds
Executed search and generated SQL INSERT script with
mysql_escape_string in 0.26493406295776 seconds
**************

The protocol around here seems to be only offering *hints* at first, so
I don't want to make anyone mad. I'm willing to share if you get
totally stumped though.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация