Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 25, 2013, 11:37:49 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: ExcludeFiles(<boolean> and Fragmented(no))  (Read 840 times)
ff_mfg
JkDefrag Hero
*****
Posts: 51


View Profile
« on: May 05, 2011, 03:31:21 pm »

It seems Fragmented(no) doesn't respect IgnoreWrapAroundFragmentation setting and treats such files as fragmented if used in ExcludeFiles. Confirmed by running same boolean in SetColor - all needed files were marked. When used in ExcludeFiles - one file that is wrapped around was not excluded.

Putting IgnoreWrapAroundFragmentation(yes) in front of ExcludeFiles somehow made it even worse: not only that file is not excluded, now it's marked yellow and says fragments=2 in status... That is weird. Isn't "yes" - default setting? So it wasn't supposed to alter behavior.

Hmm. Tried putting IgnoreWrapAroundFragmentation(no) there. Now it acts as it was originally (doesn't ignore wraparound, but later doesn't mark the file as having 2 fragments). It seems there's faulty logic in there somewhere.
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #1 on: May 06, 2011, 07:07:10 am »

Thanks for your report, I appreciate it. I have checked the sources and the Fragmented() fileboolean DOES respect the IgnoreWrapAroundFragmentation() setting. When you change the IgnoreWrapAroundFragmentation() setting all fragmented files are rescanned for wrap-around-fragmentation. However, for performance reasons only the fragmented files are rescanned. Not files that were previously seen as unfragmented. The IgnoreWrapAroundFragmentation() setting is designed to be used only once, in the beginning of a script, not on-the-fly in the middle of a script. I hope that answers your question?
Logged
ff_mfg
JkDefrag Hero
*****
Posts: 51


View Profile
« Reply #2 on: May 07, 2011, 01:51:51 am »

Umm, no, you didn't understood me it seems. I'm not trying to use IgnoreWrapAroundFragmentation in the middle of the script multiple times. It only came up because I've tried to see if it would change Fragmented() behavior in ExcludeFiles. So let's ignore IgnoreWrapAroundFragmentation use now and I'll try to restate the original problem:

The actual idea was to exclude huge defragmented files.
ExcludeFiles(Size(4GB,0) and Fragmented(no))
I worked well, until I added that to a disk (I have scripts tailored to specific disks) where I just moved a set of huge files with SortBy(Name). One of those files got wrapped around some small NTFS unmovable stuff. And it prompted me to notice when I ran the script with ExcludeFiles that in the block of these newly defragmented and put together by SortBy files one wasn't red (excluded). So I tested it with
SetFileColor(Size(4GB,0) and Fragmented(no),All,255,255,255) - that properly selects all of these files. In ExcludeFiles, one file that is wrapped around - not excluded.

Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7155



View Profile WWW
« Reply #3 on: May 09, 2011, 04:03:51 am »

Ah, I think I understand now. I had to look in the sources again and I see that in essence you are correct. Just after analyzing a disk the program will first exclude files, then load the list of unmovable files, and then check for wrap-around fragmentation. So, the program has no knowledge about wrap-around fragmentation when ExcludeFiles() is executed.

Excluding files has to be the first action, because loading the list of unmovable files involves a test to see if they are still unmovable, by trying to move them. You don't want that with excluded files. I am sorry, but I cannot solve this problem.
Logged
ff_mfg
JkDefrag Hero
*****
Posts: 51


View Profile
« Reply #4 on: May 09, 2011, 06:53:49 pm »

Ok, I understand now why it is as it is, thanks for explaining.

Basically I'm screwed Smiley, as simplified it's: A must be before B, B must be before C, but for A to function properly C has to be before A.

The only way of somewhat fixing it I can think of right now would be to load unmovables list first, do not check if files could be moved, check for wrap-around fragmentation, do ExcludeFiles, then check if unmovables can be moved, then retest files marked as wrap-around (if there is no such flag now, retest all or add a flag). Clearly, that is not the best solution and if it involves significant changes it's too much work for very little gain. Worse, it could be much slower. You'll probably ignore the proposed so-called "fix" and would be right to do so. Grin

Still, it's too bad wrap-around fragmentation (unique MyDefrag feature) doesn't work quite everywhere. Sad

P.S. I guess until it's fixed (I still hope it might happen someday) it should be mentioned in the manual.
Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #5 on: May 10, 2011, 08:35:40 am »

Instead of excluding these files using ExcludeFiles, define them as first zone and perform no action on them.

Edit: Of course you have to use MakeGap(0) after this first zone.
« Last Edit: May 10, 2011, 08:37:18 am by Kasuha » Logged
ff_mfg
JkDefrag Hero
*****
Posts: 51


View Profile
« Reply #6 on: May 11, 2011, 11:21:44 am »

Hmm, I didn't think of that. I'm not entirely sure this would prevent other zones Defragment() from moving those files out. It shouldn't, as they should be marked "optimized", but when you mess with zone order (and I've tried), sometimes strange things happen...
Thanks for an idea anyway, I might try that.
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!