Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • its in a script that auto runs and hits random dir that throw that error -- need to know ow to catch that error and then handle it trying that code -- or a work around to have the sctipt just jump into the moved to dir that holds all of the modified files then rename the directoies, but that too may pose an error if another dir of the same name is already there too --- Commented Nov 25, 2015 at 16:40
  • @uxserx-bw I do not quite get what you are aiming at and why my suggestion does not work for you. To execute some special code in case the move failed, try movecommand || specialcommand. Is that what you meant? If not, could you update your question such that it explains what exactly the intended behavior of your script is? Commented Nov 25, 2015 at 17:00
  • every time I try to give more information people just get more confused about what I am doing with my sctiprt because it does quite a few operations. I'm going to try and make it as clear as possiable what my script is doing then get to the part or parts I am having troble with -- please read it again in a few minutes as of this posting to you Commented Nov 25, 2015 at 17:17
  • @uxserx-bw It seems to me that moving the files instead of the directory as suggested above should work in both cases (note that I also added a mkdir, in case the new directory does not exist yet). So there is no real need to detect and handling any error. Or I'm still not quite getting the problem. Commented Nov 26, 2015 at 8:32
  • I am resampling mp3/flac to mp3 then orginizing them now I am keepig them in same dir del the old file after renaming it -- then when that directory is fully completed with all of the mp3/flac files rename the parent dir to the artist name off META TAG info for duplicate dir with different parent names of same artist then moveing that whole completed dir with it's subdir's into a different parent tree Music/newDIr Artist name goes here/SubDIr's/all of the files now get rid of matching dir and all of its contents in OLD Parent DIr. Y? I have a lot of duplicate files with Different DIr names Commented Nov 27, 2015 at 16:14