Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need a way to change the creation time of a file on a mounted FAT32 volume. I have to do that because my MP3 player will only read files sorted by this creation time.

If I can find a way to set the file creation time (like touch can do with modification / access time) of a file, a trivial script will allow MP3 files to be read in the right order (as expected, alphabetically).

But I've yet to find a solution, and my searches have been in vain. I hope you guys can help me !

share|improve this question
add comment

2 Answers

First thing that comes to mind is to mv the file(s) to a temporary, cp the temporary file to the old filename and delete the temporary.

I just made a fast check:

touch foo
ls -l foo

returns:

0 -rw-r--r-- 1 shunz shunz 0 2011-03-22 11:07 foo

wait some minutes and then:

mv foo bar
ls -l bar

0 -rw-r--r-- 1 shunz shunz 0 2011-03-22 11:07 bar

notice the creation time isn't modified, while:

cp bar foo
ls -l foo bar

0 -rw-r--r-- 1 shunz shunz 0 2011-03-22 11:07 bar
0 -rw-r--r-- 1 shunz shunz 0 2011-03-22 11:10 foo

now foo is created at current time!

EDIT

sorry, forgot to mention, tried this on a FAT32 formatted USB stick under Ubuntu.

share|improve this answer
add comment
up vote 3 down vote accepted

I finally ended up using fatsort, which does the job nicely, and it's also a lot quicker than copying the files over and over.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.