On 04/28/2013 08:12 PM, Steven D'Aprano wrote:
On 29/04/13 10:54, mike wrote:
Can you elaborate on what you mean regarding the musicDir variable? I
have a loadDir which specifies where the symlinks reside but the
actual root of the media directory is /opt/data/music and it's
organized via directories based on genres which is why I am specifying
musicDir instead of loadDir for this function
Your command, in part, looks like this:
linkNew = ['find', '%s' % musicDir, ...]
The first item is "find", the name of the command. The second item takes
a variable which is already a string, musicDir, and turns it into a
string using '%s' % musicDir. But it's already a string, so that's just
double-handling. Instead, write this:
linkNew = ['find', musicDir, ...]
Ahhh I see the redundancy now, the function seems satisfied with the
linkNew list with the exception of how how I'm using '-exec ...'
I get the following when executing:
rev@sheridan:~/code$ ./addsync pushnew
Enter the duration of time in days you want to link
-5
find: missing argument to `-exec'
rev@sheridan:~/code$
this is the currently working list:
linkNew = ['find', 'musicDir', '-maxdepth', '2', '-mtime', '%s' %
durFind, '-not', '-name', '%s' % fileExcl, '-exec', 'addsync {} \;']
Is this an example where I want to be calling this while emulating a shell?
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor