Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #372108
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Newsgroups | sci.electronics.design |
| Subject | Re: OT: Sort directory *entries* |
| Date | 2015-08-08 22:28 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <mq5omb$77m$1@dont-email.me> (permalink) |
| References | <mq1n8j$276$1@speranza.aioe.org> <mq1oq7$35m$1@dont-email.me> <mq2n8l$iai$1@speranza.aioe.org> |
On 07/08/15 18:44, Don Y wrote: > Hi David, > > On 8/7/2015 1:06 AM, David Brown wrote: >> On 07/08/15 09:38, Don Y wrote: >>> >>> Is there an established/built-in mechanism to reorder the dirent >>> structs on Windows filesystems? Or, is it cheaper for me just >>> to write a script to "coerce" things into the desired order? >> >> I take it you mean actually /change/ the order of the directory entries, >> rather than just make them look sorted. > > Yes. Edit the directory itself. > >> As far as I know, their is unlikely to be a way to do it for NTFS as the >> filesystem uses a B-Tree which does not track the order. So even if you >> individually copy files one-by-one into an NTFS directory, you will not >> get any particular order within the directory structures - adding a file >> could cause the B-Tree nodes to split with different divisions of the >> files. >> >> For FAT (and FAT32), it's a different matter - files are kept in a flat >> list in the directory structure, with an order than can easily be seen. >> Some devices (such as many MP3 players) handle files in that order. > > Sorry, I should have mentioned FAT32. > >> There are probably utilities for Windows that can re-order the entries. >> On Linux, there is "fatsort" which is often used for ordering files on >> USB sticks for music players. > > I just hacked together a quick shell script to sort the "names" based > on the criteria of interest, then moved them into a virgin directory. > Done. > > I was hoping there might have just been some magic incantation to do this > *for* me (e.g., Norton Utilities used to have this capability many aeons > ago). > Well, "apt-get install fatsort" then "fatsort" is almost exactly the magic you are looking for - except it is for Linux (and possibly *BSD). I expect these sorts of things are a lot easier on Linux than Windows - in particular, it's easy for a program on Linux to access an unmounted filesystems, while Windows insists on mounting filesystems which makes direct access much harder. On the other hand, Linux's caching layers make it harder to use a solution like the one you used. On Windows, the system treats the USB drive as completely dumb - and also treats the user as completely dumb. It assumes that you might pull the drive out at any moment, and therefore updates the directory and FAT continuously during a copy in order to keep these structures as current as possible. Therefore as long as you copy the files into the drive in the desired order, they will have that order in the directory structure. Linux caches metadata accesses, so the copies will be handled much faster (at least the metadata parts), but the ordering in the structures is less predictable unless your script does a "sync" between each copy.
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-07 00:38 -0700
Re: OT: Sort directory *entries* David Brown <david.brown@hesbynett.no> - 2015-08-07 10:06 +0200
Re: OT: Sort directory *entries* DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2015-08-07 05:29 -0400
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-07 09:44 -0700
Re: OT: Sort directory *entries* makolber@yahoo.com - 2015-08-07 10:36 -0700
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-07 10:59 -0700
Re: OT: Sort directory *entries* makolber@yahoo.com - 2015-08-07 13:07 -0700
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-07 13:43 -0700
Re: OT: Sort directory *entries* M Philbrook <jamie_ka1lpa@charter.net> - 2015-08-07 18:43 -0400
Re: OT: Sort directory *entries* David Brown <david.brown@hesbynett.no> - 2015-08-08 22:21 +0200
Re: OT: Sort directory *entries* upsidedown@downunder.com - 2015-08-09 00:36 +0300
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-08 14:45 -0700
Re: OT: Sort directory *entries* jurb6006@gmail.com - 2015-08-15 20:36 -0700
Re: OT: Sort directory *entries* Robert Baer <robertbaer@localnet.com> - 2015-08-07 22:12 -0700
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-07 22:39 -0700
Re: OT: Sort directory *entries* David Brown <david.brown@hesbynett.no> - 2015-08-09 13:10 +0200
Re: OT: Sort directory *entries* DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2015-08-08 02:59 -0400
Re: OT: Sort directory *entries* whit3rd <whit3rd@gmail.com> - 2015-08-07 13:44 -0700
Re: OT: Sort directory *entries* Nobody <nobody@nowhere.invalid> - 2015-08-08 03:11 +0100
Re: OT: Sort directory *entries* Jasen Betts <jasen@xnet.co.nz> - 2015-08-08 03:55 +0000
Re: OT: Sort directory *entries* upsidedown@downunder.com - 2015-08-08 09:23 +0300
Re: OT: Sort directory *entries* Robert Baer <robertbaer@localnet.com> - 2015-08-07 22:11 -0700
Re: OT: Sort directory *entries* David Brown <david.brown@hesbynett.no> - 2015-08-08 22:28 +0200
Re: OT: Sort directory *entries* Don Y <this@is.not.me.com> - 2015-08-08 14:33 -0700
Re: OT: Sort directory *entries* Jasen Betts <jasen@xnet.co.nz> - 2015-08-09 04:15 +0000
Re: OT: Sort directory *entries* David Brown <david.brown@hesbynett.no> - 2015-08-09 13:21 +0200
Re: OT: Sort directory *entries* Robert Baer <robertbaer@localnet.com> - 2015-08-07 22:04 -0700
Re: OT: Sort directory *entries* DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2015-08-08 02:58 -0400
Re: OT: Sort directory *entries* Dimitrij Klingbeil <nospam@no-address.com> - 2015-08-15 21:38 +0200
Re: OT: Sort directory *entries* Rob <nomail@example.com> - 2015-08-15 20:12 +0000
csiph-web