Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  A code / script to tell you which folder doesn't have the file cover.jpg
« previous next »
  • Print
Pages: [1]

Author Topic: A code / script to tell you which folder doesn't have the file cover.jpg  (Read 752 times)

Offline chico

  • Member
  • *
  • Posts: 1
A code / script to tell you which folder doesn't have the file cover.jpg
« on: November 20, 2011, 12:00:25 PM »
searches will tell you in which folder this file exist and it will print you a list.

How do you do the opposite, a reverse  so i can put "cover.jpg" in all the folders that don't have one.

I've gotten as far as which file is not "cover.jpg" and it prints every file that isn't. I just want to know a list of which directory doesn't have the file "cover.jpg"

either in xp bat file or in the linux ubuntu terminal


thanks in advance
Logged

Offline nick_p

  • Member
  • *
  • Posts: 115
Re: A code / script to tell you which folder doesn't have the file cover.jpg
« Reply #1 on: November 20, 2011, 09:36:27 PM »
In Linux, the following will list directories under "/your_mp3_dir" that don't contain "cover.jpg"

Code: [Select]
find /your_mp3_dir -type d -exec test ! -f {}/cover.jpg \; -print

If you wanted to copy a file "standard_cover.jpg" into each

Code: [Select]
find /your_mp3_dir -type d -exec test ! -f {}/cover.jpg \; -exec cp -n standard_cover.jpg {}/cover.jpg \;

Or if you'd like to save some space (and all the files are on the same extN partition);

Code: [Select]
find /your_mp3_dir -type d -exec test ! -f {}/cover.jpg \; -exec ln standard_cover.jpg {}/cover.jpg \;
« Last Edit: November 20, 2011, 11:15:58 PM by nick_p »
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  A code / script to tell you which folder doesn't have the file cover.jpg
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.061 seconds with 15 queries.