Enforce files/folders logical order for FindFirst/FindNext

My computer with Windows 7 is always return all files in descending order:
Directory of \2  ASSEMBLIES SECTION
06/03/2015 02:07p <80098441 Packing>                                      
06/03/2015 02:07p <80984401 Main Assy - 110V>                             
06/03/2015 02:07p <80984402 Main Assy - 220V>                             
06/03/2015 02:07p <81984403 Base Plate Assy>                              
06/03/2015 02:07p <81984404 Shroud Assy>                                  
06/03/2015 02:07p <81984405 Table Top Assy>                               
06/03/2015 02:07p <81984406 Frt Pnl Assy>                                 

<\80098441 Packing>
01/11/2010 04:32p AS80098440-1B   Final Assy.pdf                          
01/08/2010 04:43p AS81984408-1B   Skid Assy.pdf                           
01/11/2010 04:35p BM80098440-1    Final Assy.pdf                          
01/11/2010 04:41p BM80984403-0    Packing Materials.pdf                   
01/11/2010 04:46p BM80984404-1    Accessory Kit.pdf                       
01/11/2010 04:55p BM80984405-0    Hose Kit.pdf                            
01/11/2010 02:40p BM80984407-0    Ship Cont Assy.pdf                      
01/11/2010 02:38p BM81984408-1    Skid Assy.pdf                           
01/16/2012 04:48p BM82984408-0    Level Sys Assy.pdf                      
01/08/2010 03:17p FB199844XX-0A   Packing Cont.pdf                        

<\80984401 Main Assy - 110V>
05/20/2010 10:44a AS80984401-1C   Main Assy.pdf                           
03/22/2010 01:05p AS81984403-1B   Base Plt Assy.pdf                       
05/20/2010 10:59a BM80984401-1    Main Assy.pdf                           

<\80984402 Main Assy - 220V>
01/11/2010 04:37p BM80098441-1    Final Assy 220V.pdf                     

<\81984403 Base Plate Assy>
03/15/2010 04:37p BM81984403-1    Baseplate Assy.pdf                      

<\81984404 Shroud Assy>
06/30/2011 12:59p AS81984404-1B-1 Shroud Assy.pdf                         
01/08/2010 04:54p AS81984404-1B-2 Shroud Assy.pdf                         
01/11/2010 03:50p BM81984404-1    Shroud Assy.pdf                         

But the same program on Windows XP and Windows 8.1 returns data in ascending order or not sorted at all. How can I enforce descending order?
0
Fred
6/18/2015 12:48:04 AM
embarcadero.delphi.nativeapi 1236 articles. 1 followers. Follow

8 Replies
1771 Views

Similar Articles

[PageSpeed] 36
Get it on Google Play
Get it on Apple App Store

Fred wrote:

> How can I enforce descending order?

There is no guarantee or control over the order in which FindFirst/Next() 
report entries.  It depends on the layout of the underlying file system. 
 You will have to store the items into your own list and sort it as needed.

-- 
Remy Lebeau (TeamB)
0
Remy
6/18/2015 1:06:15 AM
> {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> Fred wrote:
> 
> > How can I enforce descending order?
> 
> There is no guarantee or control over the order in which FindFirst/Next() 
> report entries.  It depends on the layout of the underlying file system. 
>  You will have to store the items into your own list and sort it as needed.
> 
> -- 
> Remy Lebeau (TeamB)

Thanks Remy. I just want to know how to set file system to be sorted even externally if I can not set it in a program or I can?

Regards, Fred
0
Fred
6/18/2015 1:32:23 AM
> {quote:title=Fred Fonar wrote:}{quote}
> > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > Fred wrote:
> > 
> > > How can I enforce descending order?
> > 
> > There is no guarantee or control over the order in which FindFirst/Next() 
> > report entries.  It depends on the layout of the underlying file system. 
> >  You will have to store the items into your own list and sort it as needed.
> > 
> > -- 
> > Remy Lebeau (TeamB)
> 
> Thanks Remy. I just want to know how to set file system to be sorted even externally if I can not set it in a program or I can?
> 
> Regards, Fred

Most OSs do not sort directory entries and FindFirst/Next just returns the order they are in

If you want then in order then just create a list and sort the list ...

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
0
Linden
6/18/2015 5:23:24 AM
> {quote:title=Linden ROTH wrote:}{quote}
> > {quote:title=Fred Fonar wrote:}{quote}
> > > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > > Fred wrote:
> > > 
> > > > How can I enforce descending order?
> > > 
> > > There is no guarantee or control over the order in which FindFirst/Next() 
> > > report entries.  It depends on the layout of the underlying file system. 
> > >  You will have to store the items into your own list and sort it as needed.
> > > 
> > > -- 
> > > Remy Lebeau (TeamB)
> > 
> > Thanks Remy. I just want to know how to set file system to be sorted even externally if I can not set it in a program or I can?
> > 
> > Regards, Fred
> 
> Most OSs do not sort directory entries and FindFirst/Next just returns the order they are in
> 
> If you want then in order then just create a list and sort the list ...
> 
> --
> Linden
> "Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"

I think I've got reason of not sorted files: it was USB flash drive used to create a list of folders/files. USB system is not doing sorting as computer OS does

Regards, Fred
0
Fred
6/18/2015 5:18:51 PM
Fred wrote:

> Thanks Remy. I just want to know how to set file system to be
> sorted even externally if I can not set it in a program or I can?

You cannot.  That is why you need to store the found items in your own sorted 
list instead.

-- 
Remy Lebeau (TeamB)
0
Remy
6/18/2015 6:49:14 PM
Fred wrote:

> Thanks Remy. I just want to know how to set file system to be
> sorted even externally if I can not set it in a program or I can?

You cannot.  That is why you need to store the found items in your own sorted 
list instead.

-- 
Remy Lebeau (TeamB)
0
Remy
6/21/2015 6:40:13 AM
> {quote:title=Fred Fonar wrote:}{quote}
> > {quote:title=Linden ROTH wrote:}{quote}
> > > {quote:title=Fred Fonar wrote:}{quote}
> > > > {quote:title=Remy Lebeau (TeamB) wrote:}{quote}
> > > > Fred wrote:
> > > > 
> > > > > How can I enforce descending order?
> > > > 
> > > > There is no guarantee or control over the order in which FindFirst/Next() 
> > > > report entries.  It depends on the layout of the underlying file system. 
> > > >  You will have to store the items into your own list and sort it as needed.
> > > > 
> > > > -- 
> > > > Remy Lebeau (TeamB)
> > > 
> > > Thanks Remy. I just want to know how to set file system to be sorted even externally if I can not set it in a program or I can?
> > > 
> > > Regards, Fred
> > 
> > Most OSs do not sort directory entries and FindFirst/Next just returns the order they are in
> > 
> > If you want then in order then just create a list and sort the list ...
> > 
> > --
> > Linden
> > "Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
> 
> I think I've got reason of not sorted files: it was USB flash drive used to create a list of folders/files. USB system is not doing sorting as computer OS does
> 
> Regards, Fred

The OS (Windows) is NOT sorting the files a the HWare storage level ONLY when they are displayed - so it you want to have your files sorted do what the os does ... findFirst/FindNext into a list then SORT the list - the order of the files at the HW level is effectively random and has NOTHING to do with HDD vs USB etc - USB can be formatted with any number of different OS file systems FAT, FAT32, exFAT,  NTFS etc none of these sort the directory entries ON THE HARDWARE - typically they are in creation orde
r

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"
0
Linden
6/21/2015 8:12:52 AM
Fred wrote:

> Thanks Remy. I just want to know how to set file system to be
> sorted even externally if I can not set it in a program or I can?

You cannot.  That is why you need to store the found items in your own sorted 
list instead.

-- 
Remy Lebeau (TeamB)
0
Remy
6/24/2015 6:55:02 AM
Reply:

Similar Artilces:

How to Syncronize ftp folders & files with local folders & files
Hi Guys, I need to syncronize folders & files placed at my ftp to the folders & files in my pc. Could you please inform about, What do I need for this? How can I do this? Best regards -dan- ...

moving files,folders in one folder to another folder
how can i move files and folders from one folder to another folder in asp.net using c#. plz reply.  hi, you can do this way  DirectoryInfo dir1= new DirectoryInfo("F:Folder1"); DirectoryInfo dir2 = new DirectoryInfo("F:Folder2"); FileInfo[] Folder1Files = dir1.GetFiles(); if(Folder1Files.Length > 0) { foreach(FileInfo aFile in Folder1Files) { if(File.Exists("F:Folder2" + aFile.Name)) { File.Delete("F:Folder2" + aFil...

is there a way I can only build a specific file/folder and flash only that file/folder to my test device ?
Hi all: I was just wondering if I can build and flash only a specific file/folder which I changed in gecko and gaia folders. to be specific, inside: gecko/dom/ gaia/apps/ Because, sometimes building does not go through and gives me errors and then I do it again - it works fine. But it takes really long time to build the code and I just have to wait till its done. We are just making small changes to the files to log some data and don't want to just build complete gecko or gaia folders so many times a day. Thanks. ...

ordering by name folders inside File Cabinet
Good Day, I see my folders it's ordering by date creation, are there any procedure to ordering by name? -- Thanks for your time, Regards, JuanM ---------------------- Highlight the folder, right click, properties, display. Cheers Dave -- Dave Parkes [NSCS] Occasionally resident at http://support-forums.novell.com/ ...

all files and folders of a specific folder
I want to use the treeview to show all files and folders that are in a specific folder on the server. Can anyone help me with this please' you can do something like below.    private void BuildFolderList()    {        DirectoryInfo d = new DirectoryInfo("c:\\"); \\path to the directory        foreach (FileInfo f in d.GetFiles())        {            myTreeView.Nodes.Add(new TreeNode(f.FullName));    ...

Deleting file from file folder
please advice!I have created mechanism to upload files both into file system and database.In case if files are stored in file system - in table I save only data on how to find file.the issue is I dont know how to delete files. Deleting record with information about file is not a problem, the problem is to delete corresponding file in folder. Please help  You can use the File.Delete method. Website Design Darlington - http://mdssolutions.co.ukhttp://lessthandot.com - Experts, Information, Ideas & Knowledgehttp://aspnetlibrary.com - An online resource for professional ASP....

Open a folder not a file in this folder
I used Response.Redirect("//myWebServer/WebShareFolder/Life Insurance Enrollment Form.pdf") to open a file. It works. But, if open a folder, like below will get error: Response.Redirect("//myWebServer/WebShareFolder/") How to open entire folder WebShareFolder? aspfun:I used Response.Redirect("//myWebServer/WebShareFolder/Life Insurance Enrollment Form.pdf") to open a file. It works. But, if open a folder, like below will get error: Response.Redirect("//myWebServer/WebShareFolder/") How to open entire folder WebShareFolder? aspfun -- You may be talking about "open the folde...

Delphi XE3 lib folder list of files
Hi, I accidentally renamed a file in the Embarcadero\Rad Studio\10.0\lib directory. The file has the dcp extension and a size of 1109K and comes before the letter E. Can someone be kind enough to give me the name of this dcp file? Thank you, Denis Prince Denis Prince wrote: > Hi, I accidentally renamed a file in the Embarcadero\Rad Studio\10.0\lib directory. The file has the dcp extension and a size of 1109K and comes before the letter E. Can someone be kind enough to give me the name of this dcp file? Thank you, Denis Prince Looks like it is CloudService.dcp. -- Jeff O...

Turbo Delphi
Lately I have been working on a project in Turbo Delphi. But I have run into a small problem. I need to check if a particular folder contains a particular file, and if so, some stuff must be done… so like if Program Root Directory contains testfile.txt then begin <DO SOME STUFF HERE> end else <DO SOMETHING ELSE HERE> What is the correct function / method to use in order to achieve this ? Thanks Edited by: John Classen on Sep 4, 2008 9:06 AM John Classen wrote: > What is the correct function / method to use ...

DirectX dcu files missing from Delphi 2010 lib folder?
Is there some reason the dcu files for DirectX (eg. D3*.pas, Dx*.pas, Direct*.pas) aren't to be found in the Delphi 2010 lib folder? (.pas files are found in source\Win32\rtl\win). Dan. Daniel Bartlett wrote: > Is there some reason the dcu files for DirectX (eg. D3*.pas, Dx*.pas, > Direct*.pas) aren't to be found in the Delphi 2010 lib folder? (.pas > files are found in source\Win32\rtl\win). No. This has been reported as Report No: 78075 (RAID: 273042) Status: Open DirectX dcus missing in the lib folder http://qc.embarcadero.com/wc/qcmain.aspx?d...

superreview requested: [Bug 248759] RFE: Change: (Mail) File > Compact Folders Menu to "File Compact ALL Folders" : [Attachment 152806] Patch
Stephen Donner <stdonner@iusb.edu> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 248759: RFE: Change: (Mail) File > Compact Folders Menu to "File Compact ALL Folders" http://bugzilla.mozilla.org/show_bug.cgi?id=248759 Attachment 152806: Patch http://bugzilla.mozilla.org/attachment.cgi?id=152806&action=edit ...

superreview denied: [Bug 248759] RFE: Change: (Mail) File > Compact Folders Menu to "File Compact ALL Folders" : [Attachment 152806] Patch
Scott MacGregor <mscott@mozilla.org> has denied Stephen Donner <stdonner@iusb.edu>'s request for superreview: Bug 248759: RFE: Change: (Mail) File > Compact Folders Menu to "File Compact ALL Folders" http://bugzilla.mozilla.org/show_bug.cgi?id=248759 Attachment 152806: Patch http://bugzilla.mozilla.org/attachment.cgi?id=152806&action=edit ------- Additional Comments from Scott MacGregor <mscott@mozilla.org> I disagree with the wording change. Compact Folders is using the plural sense already. ...

Reference a file that is in a folder from another folder
I have two folders inside my application folder. One named Controles (for the user controls) and the other Estilos (for the style sheets). How do I reference a style sheet file that is in the Estilos folder from the Controles folder? I've tried the following and, even the compiler not complaining about the syntax, it didn't work, the style is not applied.   <link rel="stylesheet" href="~/Estilos/styles_css.css" type="text/css" /> Thank you.                       &n...

Transfer file/folder to network folder
Anyone please help me. How to transfer file/folder (move/copy/delete/create) to network folder using vb.net. Anyone have any source code in vb.net or C# ?Thanks & Regards--"Don't just always label good or bad about something, always have something is invisible from nude eyesight. " It is the same as your file system tools. If you are doing this from ASP.NET, it is a very easy task to get over the permissions. One being that you can just impersonate the application with another user name and "link" it up with the networked server. It also depends if you have active directory runni...

Have the solution file and project files at the same folder
Hi,  when I create a new project in Visual Studio 2008,for e.g if I create a project WebApp1 in C:/Inetpub/wwwroot folder C:/Inetpub/wwwroot/WebApp1/                                     -WebApp1(has all project files,.aspx,.aspx.cs files)                              &...

how to move file from one folder to other folder
Hello, I have a scenario like: * I have a folder APP_DATA in my ASP.NET Project * In APP_DATA folder I have two more folders (INProcess and Processed) * Now I have one Excel file in INProcess folder. * I have successfully read and enter data from this file into my database. * Now I need that after successfully entering the complete data from this file, the file must move into the Prcoessed folder. How can I do this? Need your immediate help. Thanks, Junior Use System.IO.File.Move : http://msdn2.microsoft.com/en-us/library/system.io.file.move.aspx ...

How to list all files in a folder AND sub-folders ...
Hello, Is there a function that is able to return a list of files in a folder AND all sub-folders? For example, if I want to find all *.txt files in the current folder AND in all sub-folders. I know the Dir() function can return such a list, but only for a single folder (or did I miss something). Thanks, Brent D. Check out this code sample: File System List Using System.IO NamespaceDavid WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with on...

File permission for website files/folders
Hi everyone, I have pure-ftpd setup on my OpenSuSe 11, with apache running a webserver. i've setup virtual users in pure-ftpd and linked it to the website folder (/srv/www/htdocs) i can successful login but i can't upload file to that directory. the /srv/www/htdocs is belong to wwwrun:www what should i do ? please advise.:( -- delux2000kh ------------------------------------------------------------------------ Chmod 777 htdocs will make it drwxrwxrwx so you can write (upload) there. -- 'Drop in and visit some time' (http://www.swerdna.net.au/li...

parmeter with the filed for order and type of the ordered
 I write a SP that get 2 paramteresone is the filed for orderand the second is the type of the ordered ("asc", or "desc")here is my SPCREATE PROCEDURE [dbo].[sp_PublicationPaging] (        @LanguageId int,    @PageNum int,    @TeamId int,    @PracticeId int,    @Ordered varchar(20),    @AscDesc varchar(5),    @totalCount        INT = NULL OUTPUT,    @PageSize        INT = NUL...

site file folder/file name
I need to save xml files in my asp.net application, how can I specify the file name in reference to the web site instead of file system?   fileName=Some FileName...;  Server.MapPath(@"~/FolderName/"+fileName);Chinna_sv......

superreview requested: [Bug 372100] folder icon in folder pane disappears when mail filed in folder
David Bienvenu <bienvenu@nventure.com> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 372100: folder icon in folder pane disappears when mail filed in folder https://bugzilla.mozilla.org/show_bug.cgi?id=372100 Attachment 257063: patch v1 https://bugzilla.mozilla.org/attachment.cgi?id=257063&action=edit ...

superreview granted: [Bug 372100] folder icon in folder pane disappears when mail filed in folder
neil@parkwaycc.co.uk <neil@httl.net> has granted David Bienvenu <bienvenu@nventure.com>'s request for superreview: Bug 372100: folder icon in folder pane disappears when mail filed in folder https://bugzilla.mozilla.org/show_bug.cgi?id=372100 Attachment 257063: patch v1 https://bugzilla.mozilla.org/attachment.cgi?id=257063&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil@httl.net> Thanks for spotting and fixing this. ...

I have an .aspx file located in some 'a' folder within my web folder. How can i get the path of the web folder in....
I have an .aspx file located in some 'a' folder within my web folder. How can i get the path of the web folder in order to take the path and post it in the NavigateUrl Property of a asp:Hyperlink. the problem starts when i'm clicking on the hyperlink(that located in my master page). when i'm clicking from 'a' folder it using the 'a' folder as root folder and he  searching the file from a diffrent path. (in a none exist path) for example: the navigate url is: "columns/column1.aspx" and from 'a' folder (it's a diffrent...

Upload all file in a folder / zip file handling
Hi All, I'm workng on a function which needs to read data from more then 1000 Excel files: User upload the xls files and the webpage do some calculation on server then return an Access file back to user. Q1: Is there a way to upload a folder in one shot so that users do not need to click 1000+ times to upload all the xls files? Q2: I noted there is a GZipStream object for handling .gz file on server but it seems not support .zip file. Is there some libraries for handling .zip files so that user can zip the 1000+ files in a single file for upload? Many Thanks, Stard 1) each file upload...

Web resources about - Enforce files/folders logical order for FindFirst/FindNext - embarcadero.delphi.nativeapi

DOS Kernel
DOS Kernel Interrups Categories Contents (NOT A VECTOR!) - DOS 1+ - FAR JMP instruction for CP/M-style calls DOS 1+ ABSOLUTE DISK READ (except ...

"Exploring Java8 Lambdas. Part 1"
... return a stream of subset of the elements matching the predicate findAny return an element of the stream matching the predicate findFirst ...

Geek Reading February 3, 2016 #1034
... Elmification of Swift - Design x Code Writing Next Generation Reusable JavaScript Modules in ECMAScript 6 - Smashing Magazine Beware Of findFirst() ...

p2p.wrox.com: Archives
Programmer's support and resource centre run by programmers for programmers.

BREXX, General Index
Previous Top General Index A B C D E F G H I J K L M N O P Q R S T U V W X YZ A a2e ebcdic a2u wince abbrev string abs math adddays dates addmonths ...

An introduction to UI Automation – with spooky spirographs
A few weeks ago, I unearthed a hidden gem in the .Net framework: the UIAutomation API. UI Automation made its entrance as part of .Net 3.0, but ...

Nem's Tools [Miscellaneous - HLLib]
Nem's Half-Life and Half-Life 2 editing tools.

Exploring Java8 Lambdas. Part 1
... return a stream of subset of the elements matching the predicate findAny return an element of the stream matching the predicate findFirst ...

Resources last updated: 2/27/2016 12:27:53 AM