In a point of the code I had the problem to count them,

ma in an other point I need to have them in some order.

In practice I need to establish an order.
A part of my application creates them and an other part
reads them, also some day after.
Therefore I chose to generate with names such that the
alphabetical order of the names corresponds to the oder
I want to read the files with.

I preferred to do not use database support for this task.

Any different ideas?


  ----- Original Message ----- 
  From: Rob Kennedy 
  To: [email protected] 
  Sent: Thursday, May 15, 2008 5:00 PM
  Subject: Re: [delphi-en] file counting


  mauro russo wrote:
  > Rob Kennedy wrote:
  >> mauro russo wrote:
  >>> is it possible to obtain the number of files in a directory (no
  >>> sub-directories)
  >>> without to enumerate all files, for example as FindFirst and FindNext?
  >>
  >> No. You have to count them.
  >
  > how to be sure the files are read in alphabetical arrangement?

  As the documentation for FindFirstFile says, if you want the files in a
  particular order, you need to get all the names first and then put them
  into the desired order yourself.

  FindFirstFile and FindNextFile return files in whatever order the
  filesystem driver provides them. It might be alphabetical, it might be the
  order in which they were created, or it might be any other order you can
  think of.

  But why does the order matter? You're only counting them. You'll get the
  same number no matter what order they're in.

  -- 
  Rob



   
  ----------

Questa email รจ stata verificata dal sistema centralizzato antivirus della 
UniPlan Software


[Non-text portions of this message have been removed]


------------------------------------

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/delphi-en/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to