Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 25, 2013, 04:27:07 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Selectionsets etc..  (Read 637 times)
J.O.A.T.
JkDefrag Senior
****
Posts: 30


View Profile
« on: October 14, 2009, 05:03:28 pm »

I have been looking at the ImportListFromFile action and concluded that in some instances you don't want to list every file and instead use a wildcard.

I was thinking that maybe we could add an action that imports selection sets that we can use for filebooleans.

Example:
I have a file called MySelections.MyD that contains:

/* Select only picture-files */
SelectionSet("OnlyPics)
  FileName("*.jpg")
  or FileName("*.bmp")
  or FileName("*.gif")

/* Select only temp-files */
SelectionSet("TempFiles")
  DirectoryName("Temp")
  or FileName("*.tmp")


I add in Settings.MyD or in preferred defragment-script:
LoadSelectionSet("C:\MyD-Stuff\MySelections.MyD")

And than I can use the set in defragment scripts to select files:
  /* Zone 3: files used when booting, and a gap. */
  FileSelect
    ImportListFromBootOptimize()
    and not SelectionSet("OnlyPics")
  FileActions
    Defragment()
    FastFill(WithShuffling)
    AddGap(UntilPercentageOfVolumeMultiple(1))
  FileEnd


The benefit with this approach is that instead of adding filebooleans in every script you want to modify you only need to add 1 line containing the reference to the selection set.

This also means that you can remove all FileName and DirectoryName actions from the standard scripts and have default-selections that's used in all the scripts.

What do you think?
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #1 on: October 14, 2009, 05:22:05 pm »

I add in Settings.MyD or in preferred defragment-script:
LoadSelectionSet("C:\MyD-Stuff\MySelections.MyD")

And than I can use the set in defragment scripts to select files:
This can be done with !Include Path!

  /* Zone 3: files used when booting, and a gap. */
  FileSelect
    ImportListFromBootOptimize()
    and not (!Include C:\MyD-Stuff\MySelections.MyD!)
  FileActions
    Defragment()
    FastFill(WithShuffling)
    AddGap(UntilPercentageOfVolumeMultiple(1))
  FileEnd

And put this in MySelections.MyD:
Code:
FileName("*.jpg")
  or FileName("*.bmp")
  or FileName("*.gif")

jonib
Logged

J.O.A.T.
JkDefrag Senior
****
Posts: 30


View Profile
« Reply #2 on: October 14, 2009, 09:51:12 pm »

Ah, missed that one!

Thanks!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!