Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #372159
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Newsgroups | sci.electronics.design |
| Subject | Re: OT: Sort directory *entries* |
| Date | 2015-08-09 13:10 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <mq7cc9$e6h$1@dont-email.me> (permalink) |
| References | (2 earlier) <mq2n8l$iai$1@speranza.aioe.org> <279ddad6-1af6-4c37-b1f9-9be637c9d51b@googlegroups.com> <mq2rl5$tba$1@speranza.aioe.org> <Ocgxx.23582$g72.711@fx12.iad> <mq44lk$g3g$1@speranza.aioe.org> |
On 08/08/15 07:39, Don Y wrote: > On 8/7/2015 10:12 PM, Robert Baer wrote: >> Don Y wrote: >>> On 8/7/2015 10:36 AM, makolber@yahoo.com wrote: >>>> >>>>>> 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. >>>> >>>> So how to do "see" the native order of the files in the directory via >>>> Windows. >>> >>> You don't care what the a priori order is under windows. Rather, >>> you "know" what the order *will* be when you recreate (move) the >>> files into a virgin directory. >>> >> NOT if that is NTFS. > > *Every* filesystem creates files and adds them to their "folders" > in a predictable fashion. *You* just may not be able to internalize > that ordering! There's no "random number" code built into a creat() > call that causes a file to be placed in one spot "today" and > another spot "tomorrow" -- all else being equal. What is important > is the order in which objects (files) are added to the structure > (whether that is the MFT or a "disk block" that encodes a folder > structure). > > [If these algorithms weren't deterministic, all bets would be off > and there'd be no advantage to using one particular structure > over any other RANDOM structure!] > There is no particular reason to assume this has to be deterministic, or that there is a problem with being random. The VFS and filesystem layers have to be able to handle requests in non-deterministic orders - they don't know what apps may be running, or what they might want to do with files. And with the create requests coming in in non-deterministic ordering, there is no reason to suspect that they should be written to the filesystem itself in a deterministic order (by which I mean determined by the incoming order). In particular, a high-performance filesystem will re-order the storage or physical orders based on a more complete picture of the overall performance. This may include grouping writes, combining meta-data operations, re-ordering based on access times and disk head position, etc. Even if the code is entirely deterministic and repeatable for the same set of input parameters (as will usually be the case - /intentional/ randomness is sometimes used in low-level systems, but it is rare), the algorithms can be complex and the input parameters that affect it can include not just the order of incoming requests, but the times between them, timing and ordering information from the disk, the state of caches, and statistics about past behaviour of the processes. So you are correct that (baring any intentional true random behaviour) the filesystem will react the same way to two identical requests, all other things being equal - it is generally extraordinarily difficult to have all other things being equal. And while the filesystem will normally be fully deterministic, high-performance filesystems are typically very far from being predictable. So while access to a FAT system on removable media on Windows is intentionally made to be a simple and dumb system, and therefore has reasonably predictable ordering, the same does not apply on Linux, and it does not apply to NTFS on fixed media on Windows. (An example of intentional randomness is the random hold-off period sometimes used in network communication after collisions. Adding a bit of randomness can also improve the average behaviour of some algorithms by reducing the likelihood of pathological worst cases, such as when running a standard qsort on a sorted list. I have no idea whether this is actually used in real OS's.)
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