You are here: Re: Select random files out of a directory « PHP Programming Language « IT news, forums, messages
Re: Select random files out of a directory

Posted by howa on 01/05/07 14:03

Martin Mandl - m2m tech support 寫道:

> If you have access to system commands you could try the following:
>
> 1) Get the number of files using something like: ls | wc
> 2) Use your random generator
> 3) Now pick your line e.g. for file # 123: ls | head -123 | tail -1
>
> Have fun
>
>
> howa wrote:
> > for example, there are 10K files in the directory,
> >
> > given that i don't know if files name, is it possible to fetch a file
> > randomly?
> >
> > thanks.

thanks....all examples should work for me...but a little bit slow as my
folder contains more than 10K files....thanks anyway

 

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

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