Page 1 of 1
How to calculate custom column after default columns
Posted: 13 May 2014 10:12
by Sander Bouwhuis
I am using a custom column to count the amount of files in a directory:
Settings.png
The problem is that when I click on a drive or large directory the user interface hangs for 5 to 10 seconds or so. It appears that the custom column is calculated (takes 5 or 10 secs) and only after that the files and folders are shown. After that, the size of the directories is calculated, but I can work with the user interface while it's doing this.
User Interface.png
In the screenshot you can see that the list is updated in the order 1, then 2, then 3.
But, I would like to see it in the order 2, then 3, then 1.
So, first the standard columns (after which you can use the user interface again), second the standard calculated columns, third the custom columns.
Re: How to calculate custom column after default columns
Posted: 13 May 2014 10:20
by admin
You might achieve this by setting Trigger to "List".
Also note that there is a command FolderSize() which is a bit more efficient than Report().
Re: How to calculate custom column after default columns
Posted: 13 May 2014 10:49
by Sander Bouwhuis
FolderSize() doesn't seem to work. If you take a look at the screenshot then you can see that some directories are missing sizes (e.g., the C:\Windows directory).
User Interface.png
Also, changing from Browse to List didn't seem to help either (what does that do?). It's still slow.
Re: How to calculate custom column after default columns
Posted: 13 May 2014 10:55
by admin
Show your code, please. (In Configure Custom Column right-click the Clear button in select Copy Snippet)
Well, sure it is slow. Calculating folder sizes is about the hardest thing you can do in a file system.

Re: How to calculate custom column after default columns
Posted: 13 May 2014 11:03
by Sander Bouwhuis
Code: Select all
Snip: CustomColumn 1
XYplorer 14.00.0100, 13-May-2014 11:01:18
Action
ConfigureColumn
Caption
Files
Type
3
Definition
return foldersize(<cc_item>, <f>);
Format
2
Trigger
1
Item Type
1
Item Filter
I don't mind that it is slow, but I want to continue working while it is calculating (like the standard size column). So, first show the files and folders and immediately release the user interface so I can continue to do stuff. Then, IN THE BACKGROUND, calculate the custom columns.
Also, I got this error:
Error: 10 (0x0000000A)
Desc: This array is fixed or temporarily locked
Dll: 0
Proc: cLi@20
Source: XYplorer
XY ver: XYplorer 14.00.0100
OS: Windows 7 Home Premium (Service Pack 1), 64-bit
Locale: 1033
ANSI: 1252
ACP: 1252 (ANSI - Latin I)
DBCS: No
DPI: 96 (100%)
Date: 13-May-2014 11:11:09
Re: How to calculate custom column after default columns
Posted: 13 May 2014 11:11
by admin
No, that won't work. Custom Columns are not processed in the BACKGROUND.
BTW, your scripts seems to work fine here.
Re: How to calculate custom column after default columns
Posted: 13 May 2014 11:17
by Sander Bouwhuis
That's a shame, because the standard size column (that calculates the folder size) DOES allow us to continue working.
So, how about the C:\Windows folder missing the count?
Re: How to calculate custom column after default columns
Posted: 13 May 2014 11:46
by admin
iycgtptyarvg wrote:So, how about the C:\Windows folder missing the count?
Like I said, it works here. Cannot explain it.