Deleting orphans

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisjj
    Carpal Tunnel
    • Apr 2008
    • 2537

    Deleting orphans

    I have a batch process that converts WMAs to WAVs and want BC to afterwards delete any orphan WAVs. How do I code this as a standalone script i.e. not relying on a stored session?

    Thanks.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello Chris,

    You would need to create an Alignment Override as a session default to match *.wma and *.wav (or use a saved session, and then load a pair of folders):
    load WMAtoWAVsession
    load "c:\folder1wma" "c:\folder2wav"
    expand all
    select right.orphan.files
    delete right

    As with all script, I strongly recommend testing it on already backed up files or test files, since the delete may be permanent and not undo-able if it does not behave as you expect. This goes doubly true with the Alignment Override, since if it does not work as you expect, then all of your right files are potentially considered Orphans, and the script would delete **all** of them.
    Aaron P Scooter Software

    Comment

    • chrisjj
      Carpal Tunnel
      • Apr 2008
      • 2537

      #3
      I asked "as a standalone script". Are you saying this is not possible?

      > This goes doubly true with the Alignment Override, since if it does not work as you expect

      I expect it not to work as I expect. Relying on such a session default in scripts is a recipe for disaster!
      Last edited by chrisjj; 05-Oct-2010, 05:29 PM.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16002

        #4
        Correct. There is no script command for setting a Alignment Overrides at this time.
        Last edited by Aaron; 06-Oct-2010, 05:27 PM. Reason: opps. meant Alignment Overrides (not Text Replacements)
        Aaron P Scooter Software

        Comment

        • chrisjj
          Carpal Tunnel
          • Apr 2008
          • 2537

          #5
          Originally posted by Aaron
          Correct.
          Thanks. Are there plans to complete the addition of the comparison functions to scripting?

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16002

            #6
            It's on our wishlist to add features to scripting. For now, however, you'll want to use a session.

            Could you go into more detail on your workflow? Is there a technical hurdle that stops you from using the saved session?
            Aaron P Scooter Software

            Comment

            • chrisjj
              Carpal Tunnel
              • Apr 2008
              • 2537

              #7
              Originally posted by Aaron
              It's on our wishlist to add features to scripting.
              Thanks.

              Originally posted by Aaron
              For now, however, you'll want to use a session.
              Not at all. I cannot have scripts in projects dependent on registry content.

              Originally posted by Aaron
              Could you go into more detail on your workflow?
              I have a project that needs to on different OS installations. It includes portable BC.

              Originally posted by Aaron
              Is there a technical hurdle that stops you from using the saved session?
              Sure - that BC insists such goes in the registry rather than in my project folder.

              I am sure there are many developers here with the same requirements i.e. to be able to restore a project by folder restore, without altering the registry. I'd like to hear how they manage to use BC sessions in such projects' scripts.

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16002

                #8
                BC3 does not store Session settings in your registry. By default, we store all session information in the BCSessions.xml file. This file will be located in your %AppData% directory for a normal installation, or in the program directory (next to BCompare.exe) in a Portable install. You can browse directly to these files from the Help menu -> Support, and click the blue link to Explore Settings Folder.

                A Portable install is designed to store and contain all information in the portable device, so it does not alter your registry.
                Aaron P Scooter Software

                Comment

                • chrisjj
                  Carpal Tunnel
                  • Apr 2008
                  • 2537

                  #9
                  Originally posted by Aaron
                  BC3 does not store Session settings in your registry.
                  I stand corrected.

                  Originally posted by Aaron
                  or in the program directory (next to BCompare.exe) in a Portable install.
                  OK, I will try that.

                  But making a separate install of BC for each project is a poor solution so I still hope you will add session path selection by command line.

                  Thanks.

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16002

                    #10
                    I do not have enough information on your current setup to know why you need a separate BC install for each project.

                    If your BC install can be on a single machine, you can use folders in the graphical interface to separate sessions for different projects.

                    If your projects are on different computers, you can setup a Shared Sessions.xml and access it from any machine on the network. This is under the Options dialog -> General section.

                    If your machines are not networked, you can use a portable USB device to carry your BC3 install and settings.


                    Update: talked with Craig. He brought up this is probably related to your earlier requests with versioning specific settings with specific projects. That makes sense. I was focused on the request to delete orphan wma and wav and missed the connection to your bigger picture item.
                    Last edited by Aaron; 08-Oct-2010, 04:01 PM. Reason: Updated
                    Aaron P Scooter Software

                    Comment

                    • chrisjj
                      Carpal Tunnel
                      • Apr 2008
                      • 2537

                      #11
                      Originally posted by Aaron
                      I do not have enough information on your current setup to know why you need a separate BC install for each project.
                      I see no other way to store sessions as part of the project. Do you?

                      Originally posted by Aaron
                      If your BC install can be on a single machine, you can use folders in the graphical interface to separate sessions for different projects.
                      That's just presentation. It is no help at all to keeping a project self-contained e.g. archivable and restorable.

                      Originally posted by Aaron
                      If your projects are on different computers, you can setup a Shared Sessions.xml and access it from any machine on the network. This is under the Options dialog -> General section.

                      If your machines are not networked, you can use a portable USB device to carry your BC3 install and settings.
                      Thanks, but neither meets the requirement.

                      Originally posted by Aaron
                      Update: talked with Craig. He brought up this is probably related to your earlier requests with versioning specific settings with specific projects. That makes sense. I was focused on the request to delete orphan wma and wav and missed the connection to your bigger picture item.
                      It is not a question of versioning, but simply storing. If a project that invokes BC to perform something like deleting orphans as part of a build, this must remain intact as part of the project, and independent of the machine it is running on. I.e. not get lost or changed because the some BC setting is stored outside the project e.g. global for the user.

                      That is acheivable with the currrent BC when deleting orphans of the same type, but not when deleting e.g. .OBJ from .C or in this current case .WAV from .WMA. I consider the general limitation that causes this case to be lamentable. It makes much of the power of BC lost to serious automated usage.

                      Comment

                      • chrisjj
                        Carpal Tunnel
                        • Apr 2008
                        • 2537

                        #12
                        Originally posted by chrisjj
                        I see no other way to store sessions as part of the project. Do you?
                        Please?

                        Comment

                        • Aaron
                          Team Scooter
                          • Oct 2007
                          • 16002

                          #13
                          It's on our wishlist, but you will need to use multiple Portable installs for now to keep self-contained project installs.
                          Aaron P Scooter Software

                          Comment

                          • chrisjj
                            Carpal Tunnel
                            • Apr 2008
                            • 2537

                            #14
                            OK, thanks Aaron.

                            Comment

                            Working...