Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dir file-list issue.

1 view
Skip to first unread message

Enzo

unread,
Jun 26, 2008, 8:05:55 AM6/26/08
to

I have a simple mp3 car player which plays files from an USB
pen driver formatted in FAT32.
The player does not support random play but it plays the mp3
files in the order it "sees" them, which is the same
order produced by a simple "dir" command issued on a cmd XP console.

I made a few tests:
if the USB pen is empty and I copy some files on it
in the following order:

file2.mp3
file3.mp3
file1.mp3
file4.mp3

a dir command shows them in the copy order (2-3-1-4) and the
player plays them in the same order: 2-3-1-4

Now the question is:
how would I rearrange the content order of the pen in the quickest
way (hopefully without having to delete/recopy the files with a
different order, if possible) so that a "dir" command
(with no options) produces a differently sorted file list?

It seems to be someway possible...
I tried changing the name of some of the files.
In some cases the renaming changes the position of the renamed file
in the dir list, but sometimes it does not (regardless ASCII sorting
aspects).
I wasn't able to extract any repeatable/affordable rule
from my renaming experiments...
If only I knew a valid method/algorithm/tool to reorder files
based on file renaming (or anything else but file delete/copying),
my problem would be fixed.
I'have a good experience with Visual Basic programming, but so far
I've never faced something which seems to be a FAT related issue,
with VB; don't even know if it's possible.

What I need exactly to do is to periodically rearrange the
files in the USB pen in a new random order so that
when inserted in the player it will produce music in a different
sequence.

Any help appreciated.

P.S.
If this is not the right NG, please accept my apologies
and, if possible, point me to the right direction.
TIA

B.R.

Enzo

-----
This article posted from the free web access interface to the
Internet Partners Inc. Usenet news server, at http://news.ipinc.net.
Check out Portland's full-service business Internet Service Provider at:
http://www.ipinc.net. The user making this post is doing so from a computer
using IP address 87.11.247.16

Robert Riebisch

unread,
Jun 26, 2008, 10:36:42 AM6/26/08
to
Enzo wrote:

> I have a simple mp3 car player which plays files from an USB
> pen driver formatted in FAT32.
> The player does not support random play but it plays the mp3
> files in the order it "sees" them, which is the same
> order produced by a simple "dir" command issued on a cmd XP console.

The solution is called FATSort: http://hem.passagen.se/chsw/fatsort/

--
Robert Riebisch
Bitte NUR in der Newsgroup antworten!
Please reply to the Newsgroup ONLY!

Ted Davis

unread,
Jun 26, 2008, 10:55:34 AM6/26/08
to

FAT file system the FindFirst() and FindNext() API functions return
matches in the order the files appear in the physical directory. The file
creation functions use the first available entry in the File Allocation
Table, which may be one from a deleted or moved file. In a new directory,
the order returned by FindFirst() and FindNext() to the DIR utility will
be the order of file creation; in a previously used directory, it may or
may not, depending on the history of deletions and, perhaps, other events.

To change the order returned by FindFirst() and FindNext(), you need to
change the order of the entries in the directory's FAT - not an easy or
safe task, and one best done in assembly and in Real DOS.

--
T.E.D. (tda...@mst.edu)

Herbert Kleebauer

unread,
Jun 26, 2008, 12:53:50 PM6/26/08
to
Enzo wrote:
>
> I have a simple mp3 car player which plays files from an USB
> pen driver formatted in FAT32.
> The player does not support random play but it plays the mp3
> files in the order it "sees" them, which is the same
> order produced by a simple "dir" command issued on a cmd XP console.

If the player plays the files also when not stored in the root
directory but in a sub directory, put all files in a sub directory.
Then generate a new sub directory and move (not copy) the files
in a the wanted order (or use a random order) in the new sub
directory and delete the old directory.

If the player doesn't support sub directories, move all files
in a temporary sub directory and then back in the root directory
in the wanted order.

Richard Bonner

unread,
Jul 19, 2008, 6:51:22 PM7/19/08
to
Enzo (en...@enzo.it) wrote:
> I have a simple mp3 car player which plays files from an USB
> pen driver formatted in FAT32.
> The player does not support random play but it plays the mp3
> files in the order it "sees" them, which is the same
> order produced by a simple "dir" command issued on a cmd XP console.
(Snip)

> Now the question is:
> how would I rearrange the content order of the pen in the quickest
> way (hopefully without having to delete/recopy the files with a
> different order, if possible) so that a "dir" command
> (with no options) produces a differently sorted file list?

> Enzo

*** As suggested, FATSort will work for you. DOS users can employ
Norton's "Directory Sort" program.

Richard Bonner
http://www.chebucto.ca/~ak621/DOS/

0 new messages