Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 18, 2013, 03:00:34 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Move 1 file to the end  (Read 1196 times)
WindHydra
JkDefrag Hero
*****
Posts: 69


View Profile
« on: April 26, 2009, 07:38:31 am »

How do I move 1 file to the end of the volume, something like reversed ForcedFill?  I tried using ExcludeFile and it took forever.  And when I use AtPercentageOfVolume(100) it calculates the space required for all files and moved the zone down.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: April 26, 2009, 10:11:11 am »

The program is designed for placing all the files on the disk, not for placing only a single file at a specific location. It's possible, but a bit awkward. You are on the right track with ExcludeFiles and AtPercentageOfVolume. Here is an example script, modify as needed:

Code:
# Exclude the files that you do NOT want to move to the end of the disk. */
ExcludeFiles(All and not(FileName("*.avi")))

# Analyze the volume and move the not-excluded files to the end of the disk.
VolumeSelect
  CommandlineVolumes()
VolumeActions
  SetBeginOfZone(AtPercentageOfVolume(100))
  FileSelect
    All
  FileActions
    SortByName(Ascending)
  FileEnd
VolumeEnd

p.s. At the moment this script will be extremely slow because it treats the files that are selected with ExcludeFiles() as unmovable files, and just after analysis it tests if the unmovable files are still unmovable. I am working on it, this script will be faster in the future.
Logged
jimbo
JkDefrag Hero
*****
Posts: 84


View Profile
« Reply #2 on: April 27, 2009, 09:21:43 am »

could you do something like...
Code:
VolumeSelect
  CommandlineVolumes()
VolumeActions
  FileSelect
    All and not (FileName("myfile.avi"))
  FileActions
  FileEnd

  SetBeginOfZone(AtPercentageOfVolume(100) DoNotVacate)
  FileSelect
    All
  FileActions
    SortByName(Ascending)
  FileEnd
VolumeEnd

to create a zone for all the other files, to which you did nothing.

I haven't tested the above, and I suspect that you would need to have a large enough free space at the end of the volume for the file to fit in, but it is essentially how I move 150Gb TrueCrypt containers to the back end of disks here, though I actually defrag and optimize the start of the disks as well (standardish script), which means that the space on the end of the disk is already free.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #3 on: April 27, 2009, 10:39:53 am »

could you do something like...
Yes, your script should also work.
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!