Getting Max to delete files


    Aug 29 2006 | 3:05 pm
    Hi there all,
    I am using Max to record .wavs and then convert these into .mp3 (quality is not a major concern) so that they can be stored on a server for use later. I am having problems getting Max to auto delete the .wavs once converted.
    I am using the 'rm' object to delete the files, but, nothing happens - I get no error messages or anything.
    If I try and delete the file manually I get an error message saying the file is currently in use. This occurs even though I may have recorded more files since the one I want to delete.
    I'm assuming Max is keeping track of recently used files and not letting me delete any files in its "list". Does anyone know how many files are tracked? or if there's another way of deleting files that does not suffer from this problem? or any other help?
    Thanks

    • Aug 29 2006 | 3:45 pm
      first thing you should know is that the "Max rm object" simply sends
      the "rm command" to the shell with the argument of the filepath.
      so go directly to the shell and test the rm command. (its not scary,
      just send rm (filepath) )
      remember to escape your spaces. in the shell, just like in max, a
      space in a string separates commands. so "my folder" means
      something different than "my folder" (don't include quotes)
      after you get that working, remember that there's all sorts of trap
      doors with escaping spaces in max. (it sucks but we deal)
      I'm pretty sure max does not "keep track" of those files. you might
      want to get info and check permissions.
      I think im tapped on that subject.
      other than that I give the floor to a more senior maxer
      -matt
    • Aug 29 2006 | 4:36 pm
      I've had a potentially max shattering idea for an object.
      Programming it myself would be like telling "the rock" to do
      calculus. so I figured I'd write a sample logical flow out for fun.
      just in case someone felt like solving this thorn in ALL maxers sides.
      my name is andy and I like Macintosh HD Applications Audio Worm
      AUDIO WORM v1 very much
      TO
      my name is andy and I like "Macintosh HD/Applications/Audio Worm/
      AUDIO WORM v1" very much
      .
      1 check first words of all volume names
      2 is "my" the first word of a volume name?
      3 is "name" the first word of a volume name?
      4 is "is" the first word of a volume name?
      5 is "andy" the first word of a volume name?
      6 is "and" the first word of a volume name?
      7 is "I" the first word of a volume name?
      8 is "like" the first word of a volume name?
      9 is " Machintosh" the first word of a volume name? YES!!!!!
      10 is "HD" the second word of the volume whose name starts with
      "Macintosh" ? YES
      11 is "Applications" the third word of the volume whose name starts
      with "Macintosh HD" ? NO!!!!!!
      12 element 1 of the foundPath array = "Macintosh HD"
      13 is "Applications" the first word of a file or folder in
      "Macintosh HD" ? Yes
      14 is "audioworm" the second word of the file or folder that starts
      with the word "Applications" ? NO!!!!!
      15 element 2 of the foundPath array = "Applications"
      16 is Applications a folder? Yes!!!
      17 is "audioworm" the first word of any file or folder name inside
      "Applications"? YES!!!!
      18 is "audio" the second word of the file or folder that starts
      with "audioworm" NO
      19 element 3 of the foundPath array = "audio worm"
      20 is "audio worm" a folder? YES!
      21 is "audio" the first word of any file or folder inside "audio
      worm"? YES!!!
      22 is "worm" the second word of the file or folder whose name
      begins with "audio"? YES!!!!!
      23 is "v1" the third word of the file or folder whose name begins
      with "audio worm"? YES!!!!!
      24 is "very" the fourth word of the file or folder whose name
      begins with "audio worm v1"? NO
      26 element 4 of the foundPath array = "audio worm v1"
      27 is "audio worm v1" a folder? NO!!!!!
      27 is "very" the first word of a volume name?
      28 is "much" the first word of a volume name?
      29 insert slashes, back slashes and quotes in the proper places.
    • Aug 29 2006 | 4:44 pm
      shell object is your friend.
    • Sep 01 2006 | 5:52 am
      Dave Raybould wrote:
      > I'm assuming Max is keeping track of recently used files and not
      > letting me delete any files in its "list". Does anyone know how many
      > files are tracked? or if there's another way of deleting files that
      > does not suffer from this problem? or any other help?
      I think Max would keep a file busy, till you open a new recording or
      dispose the patcher containing the sfrecord~. I assume you're using
      sfrecord to record it?
      You could dispose the sfrecord eventually with scripting (didn't try
      those assumptions though...)
      Stefan
      --
      Stefan Tiedje------------x-------
      --_____-----------|--------------
      --(_|_ ----|-----|-----()-------
      -- _|_)----|-----()--------------
      ----------()--------www.ccmix.com