----- Original Message ----- 
From: "mauro russo" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, May 15, 2008 6:04 PM
Subject: Re: [delphi-en] file counting


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 module of my application creates them and an other module
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.

Morover, as answer for Jangita,
in many cases the writing operations of the first application module
and th reading operations of the second application module
can be concurrent, and so I cannot pre-read all files.

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




  ----------

Questa email è stata verificata dal sistema centralizzato antivirus della 
UniPlan Software


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

Reply via email to