Subscribe to feed

Posts Tagged ‘osx’

I’ve been tearing my hair out for an afternoon working with a simple DB application for the iPhone/iPad. Essentially it connects to a sqlite3 database as the source file. But each time I edited that database content in Terminal, nothing was changing in the application when run.

Finally a solution. Need to reset the simulator itself to remove the local copy taken/needed when running a DB application.

Option you need is Reset Contents and Settings… under the iPhone Simulator menu.

Once reset when the application is run it pulls the updated database across as its copy. Phew!

Share

From Security expert Charlie Miller, in an article on computer security:

Mac OS X is like living in a farmhouse in the country with no locks, and Windows is living in a house with bars on the windows in the bad part of town.

Share

Every now and then you’re really grateful OSX is essentially Unix with a smiley face. Since that allows you to easily get under the hood for those “should be simple” tasks.
For this one, I needed to produce a list of files within a collection of folders which, for demonstration purposes, we’ll call media files.

Recursive file list

This is easy:

  1. Open a terminal window
  2. Type cd (there’s a space after ‘cd’)
  3. Drag the folder you want to start from into the terminal window. It should then complete the path automagically.
  4. Press Enter to navigate to the selected folder.
  5. Enter the command ls -RF > list.txt

This will produce a list of all files in the directory, and subdirectories, as list.txt in the starting directory. Feel free to give it a more useful name.

Once more, with filters

So now you’ve got a list of all the files in the folders. But if you want to find a subset based on filename (say, for example, the list of media files identified in the title as being 2009 releases) then use the wonders of unix to ‘pipe’ the file list to GREP to filter it before writing the file:

ls -RF | grep '2009' > 2009.txt

This will produce a list of only those files with ’2009′ somewhere in the title.

Advanced options

Armed with LS and GREP you can pretty much produce any subset of any folder set you require. Enjoy!

Share