Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 26, 2013, 04:23:21 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: Fileboolean equivalent to /*SPACEHOGS*/  (Read 2442 times)
poutnik
JkDefrag Hero
*****
Posts: 1105


View Profile
« on: March 14, 2009, 10:56:04 am »

I separated filebooleans from MyDefrag.log, that are in fact generated by /*SPACEHOGS*/ macro.

Instead of

( "My selection" )
/*SPACEHOGS*/

you can use

( "My selection" )
and not ( long expression below )

Why ?

The Spacehog expression has 2 advantages against /*SPACEHOGS*/ macro:

1)  you can easily tweek SPACEHOGS according your needs,
Using /*SPACEHOGS*/ macro is limited in adding files to spacehogs by names only and only in command line.
And - it is impossible to remove files from Spacehogs.

2) You can use it in file booleans instead of not available function Spacehog(No).
By removing Not function you get equivalent of function Spacehog(yes)

Obvious disadvantage is loss of script compactness.
-----------------
Edit:Note that be careful with usage until directoryname issue is solved.
(will not choose files in directry if the mentioned directory itself was chosen before )
You can use e.g. fullpath("?:*\fonts\*) instead of DirectoryName("Fonts") , but is is slower.

-----------------
Edit2:  If you are NOT using Last Access timestamps in your system (default in vista)
and using MyDefrag beta 2, remove LastAccess expression.

Otherwise due a bug all files will be set as spacehogs.
Neither use /*SPACEHOGS*/ macro for the same reason.


see http://www.kessels.com/forum/index.php?topic=1631.0
-----------------

Code:

    and not( 
      Size(50000000,0)
      or LastAccess("","1 months ago")   
// fixed a bug  "0" ->  ""
// changed month -> months ( to be sure to follow syntax )
      or DirectoryName("$RECYCLE.BIN")              or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")                  or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")  or DirectoryName("Ehome")
      or DirectoryName("Fonts")                     or DirectoryName("Help")
      or DirectoryName("I386")                      or DirectoryName("IME")
      or DirectoryName("Installer")                 or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")      or DirectoryName("Speech")
      or DirectoryName("Symbols")                   or DirectoryName("ie7updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or FileName("*.7z")            or FileName("*.arj")       or FileName("*.avi")
      or FileName("*.bak")           or FileName("*.bup")       or FileName("*.bz2")
      or FileName("*.cab")           or FileName("*.chm")       or FileName("*.dvr-ms")
      or FileName("*.gz")            or FileName("*.ifo")       or FileName("*.log")
      or FileName("*.lzh")           or FileName("*.mp3")       or FileName("*.msi")
      or FileName("*.old")           or FileName("*.pdf")       or FileName("*.rar")
      or FileName("*.rpm")           or FileName("*.tar")       or FileName("*.wav")
      or FileName("*.wmv")           or FileName("*.vob")       or FileName("*.z")
      or FileName("*.zip")
      )
« Last Edit: March 25, 2009, 11:39:10 pm by poutnik » Logged

It can be fast, good or easy. You can pick just 2 of them....
Treating Spacehog zone by the same effort as Boot zone is like cleaning a garden by the same effort as a living room.
cg
JkDefrag Hero
*****
Posts: 101


View Profile
« Reply #1 on: March 16, 2009, 03:30:37 pm »

I like where you're going with this - makes it easy to set exactly what you want to consider spacehogs.   I just downloaded MyDefrag for the first time so I'm not yet up to understanding the scripting language.  Would you mind taking this snippet and put it in a simple full script for us novices?  It'd help me understand the big picture of what's happening.
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #2 on: March 16, 2009, 03:37:59 pm »

Would you mind taking this snippet and put it in a simple full script for us novices?  It'd help me understand the big picture of what's happening.
Here is a sample script that might help, you can expand it with poutnik's Filebooleans.

jonib

« Last Edit: March 16, 2009, 03:39:33 pm by jonib » Logged

poutnik
JkDefrag Hero
*****
Posts: 1105


View Profile
« Reply #3 on: March 16, 2009, 04:29:24 pm »

I like where you're going with this - makes it easy to set exactly what you want to consider spacehogs.   I just downloaded MyDefrag for the first time so I'm not yet up to understanding the scripting language.  Would you mind taking this snippet and put it in a simple full script for us novices?  It'd help me understand the big picture of what's happening.
It was posted exactly for these reasons, to be handy if anybody like to use it. :-)
Logged

It can be fast, good or easy. You can pick just 2 of them....
Treating Spacehog zone by the same effort as Boot zone is like cleaning a garden by the same effort as a living room.
Watt
Newbie
*
Posts: 2


View Profile
« Reply #4 on: March 18, 2009, 01:04:14 am »

I've downloaded Mydefrag today, and understand a bit the script language. I think understand you Poutnik, we need the SPACEHOGS boolean! When u want separate a zone like "?\windows\*" but there are SPACEHOG areas in that zone, u can not do it correctly, bcoz u can not use the /*SPACEHOG*/ like a boolean. Only u can use the long list what u wrote in the first code!

Code:
# MyDefrag v4.0
#

Title('Teljes C:\ optimalizációja (c) Pintér István 2009')
Description('A C meghajtó optimalizálása.')

Slowdown(/*SLOWDOWN*/)
Debug(0)
OtherInstances(exit)
WhenFinished(/*WHENFINISHED*/)
windowsize(maximized)
Language("Magyar")

VolumeSelect
  Removable(no)
  and Writable(yes)
  and Mounted(yes)
  and name("c:")
  /*VOLUMES*/
VolumeActions

  ReclaimMFTzone()

  FileSelect
    FileName("$mft")
    /*EXCLUDE*/
  FileActions
    SortByName(Ascending)
    forcedfill()
  FileEnd

  SetBeginOfZone(/*FREESPACE*/)

  FileSelect
    Directory(yes)
    /*EXCLUDE*/
  FileActions
    SortByName(Ascending)
    forcedfill()
  FileEnd

  FileSelect
    ImportListFromBootOptimize()
    /*EXCLUDE*/
  FileActions
    SortByImportSequence(Ascending)
    forcedfill()
  FileEnd

pause("")

  SetBeginOfZone(/*FREESPACE*/)

  FileSelect
    fullpath("?:\Windows\*") and not (
      DirectoryName("$RECYCLE.BIN")              or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")                  or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")  or DirectoryName("Ehome")
      or DirectoryName("Fonts")                     or DirectoryName("Help")
      or DirectoryName("I386")                      or DirectoryName("IME")
      or DirectoryName("Installer")                 or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")      or DirectoryName("Speech")
      or DirectoryName("Symbols")                   or DirectoryName("ie7updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or FileName("*.7z")            or FileName("*.arj")       or FileName("*.avi")
      or FileName("*.bak")           or FileName("*.bup")       or FileName("*.bz2")
      or FileName("*.cab")           or FileName("*.chm")       or FileName("*.dvr-ms")
      or FileName("*.gz")            or FileName("*.ifo")       or FileName("*.log")
      or FileName("*.lzh")           or FileName("*.mp3")       or FileName("*.msi")
      or FileName("*.old")           or FileName("*.pdf")       or FileName("*.rar")
      or FileName("*.rpm")           or FileName("*.tar")       or FileName("*.wav")
      or FileName("*.wmv")           or FileName("*.vob")       or FileName("*.z")
      or FileName("*.zip")
      )
    /*EXCLUDE*/
  FileActions
    defragment()
    forcedfill()
  FileEnd

#pause("")

  SetBeginOfZone(PlusPercentageOfDiskFree(5))

  FileSelect
    all
    /*EXCLUDE*/
  FileActions
    defragment()
    forcedfill()
  FileEnd

VolumeEnd


The other problem is the hierarcy of the definied fileboolean elements in the zones.

Quote
There will usually be more than one FileSelect-FileActions-FileEnd structure inside a VolumeAction. This will create multiple zones, each zone with it's own items. Items will be placed in the first possible zone, in other words, if an item has been selected by a FileBoolean then it will automatically not be selected by the next FileBooleans.

Once u definied a set of elements u can not define a subset from those elements. And if the next zone fileboolean condition is that subset of elements u can not define it!
Logged
poutnik
JkDefrag Hero
*****
Posts: 1105


View Profile
« Reply #5 on: March 18, 2009, 06:45:28 am »

Code:
  FileSelect
    fullpath("?:\Windows\*") and not (
      DirectoryName("$RECYCLE.BIN")              or DirectoryName("RECYCLED")
      or DirectoryName("RECYCLER")                  or DirectoryName("$*")
      or DirectoryName("Downloaded Installations")  or DirectoryName("Ehome")
      or DirectoryName("Fonts")                     or DirectoryName("Help")
      or DirectoryName("I386")                      or DirectoryName("IME")
      or DirectoryName("Installer")                 or DirectoryName("ServicePackFiles")
      or DirectoryName("SoftwareDistribution")      or DirectoryName("Speech")
      or DirectoryName("Symbols")                   or DirectoryName("ie7updates")
      or DirectoryName("dllcache")
      or DirectoryName("Installshield Installation Information")
      or DirectoryName("System Volume Information")
      or DirectoryName("windows.old")
      or FileName("*.7z")            or FileName("*.arj")       or FileName("*.avi")
      or FileName("*.bak")           or FileName("*.bup")       or FileName("*.bz2")
      or FileName("*.cab")           or FileName("*.chm")       or FileName("*.dvr-ms")
      or FileName("*.gz")            or FileName("*.ifo")       or FileName("*.log")
      or FileName("*.lzh")           or FileName("*.mp3")       or FileName("*.msi")
      or FileName("*.old")           or FileName("*.pdf")       or FileName("*.rar")
      or FileName("*.rpm")           or FileName("*.tar")       or FileName("*.wav")
      or FileName("*.wmv")           or FileName("*.vob")       or FileName("*.z")
      or FileName("*.zip")
      )
    /*EXCLUDE*/
  FileActions
    defragment()
    forcedfill()
  FileEnd


What I can see,
your zone definition is equivalent to this :

Code:
  FileSelect
    fullpath("?:\Windows\*")
    /*SPACEHOGS/*
  FileActions
    defragment()
    forcedfill()
  FileEnd

But see my notes about systems not using Last Access timestamps and MyDefrag beta 2.

Quote
Once u definied a set of elements u can not define a subset from those elements. And if the next zone fileboolean condition is that subset of elements u can not define it!

Such behavior is expected, what was selected in previous zones, cannot be selected anymore.
Or I did not understand your post.  Smiley
Logged

It can be fast, good or easy. You can pick just 2 of them....
Treating Spacehog zone by the same effort as Boot zone is like cleaning a garden by the same effort as a living room.
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!