rejetto forum

Testing build #244

rejetto · 14 · 9936

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
download @ www.dovedove.it/hfs/hfs244.exe

what's new
+ new symbols %old-name% and %new-name% for event [on macro rename]
+ running a {.rename.} during [on macro rename] won't fire the event again (but you can override this with parameter "recursive")
+ {.add folder|overwrite=XXX.}
+ {.regexp|replace=XXX.}
- the pattern in {.regexp.} can now be {:quoted:} so that you can use the pipe "|"
- {.regexp.} was sometimes failing
- {.from table|#ini.} was not handling correctly the "no" values
- total in/out were not reset with "reset totals"




Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
bug report:
 unexpected exception when select all items in the VFS and convert all folders from real to virtual

Quote
Access violation at address 004CE6FB in module 'hfs244.exe'. Read of address 00000024
HFS 2.3 beta (244)
----------------------------------------------------------------
Stack list, generated 31/08/2009 23:30:02
[004CE6FB]{hfs244.exe  } ComCtrls.TTreeNode.SetImageIndex (Line 7185, "ComCtrls.pas" + 1) + $3
[0042D7A4]{hfs244.exe  } Classes.StdWndProc (Line 11572, "classes.pas" + 8) + $0
[004733DA]{hfs244.exe  } Controls.TControl.SetVisible (Line 4169, "Controls.pas" + 6) + $5
[00473DB8]{hfs244.exe  } Controls.TControl.Hide (Line 4510, "Controls.pas" + 1) + $5
[00558A21]{hfs244.exe  } main.TmainFrm.addFile (Line 7414, "main.pas" + 4) + $9
[00541DD9]{hfs244.exe  } main.Tfile.setupImage (Line 2531, "main.pas" + 2) + $C
[0056CFB6]{hfs244.exe  } main.TmainFrm.Switchtovirtual1Click (Line 11835, "main.pas" + 19) + $9
[004685E1]{hfs244.exe  } Menus.TMenuItem.Click (Line 1878, "Menus.pas" + 14) + $C
[00469DFD]{hfs244.exe  } Menus.TMenu.DispatchCommand (Line 2603, "Menus.pas" + 5) + $5
[0046B1EC]{hfs244.exe  } Menus.TPopupList.WndProc (Line 3393, "Menus.pas" + 4) + $12
[0046B129]{hfs244.exe  } Menus.TPopupList.MainWndProc (Line 3374, "Menus.pas" + 2) + $8
[0042D7A4]{hfs244.exe  } Classes.StdWndProc (Line 11572, "classes.pas" + 8) + $0
[0046F00C]{hfs244.exe  } Controls.FindControl (Line 2103, "Controls.pas" + 6) + $C
[004979AE]{hfs244.exe  } Forms.TApplication.ProcessMessage (Line 7670, "Forms.pas" + 23) + $4
[004979F3]{hfs244.exe  } Forms.TApplication.HandleMessage (Line 7689, "Forms.pas" + 1) + $6
[00497C8E]{hfs244.exe  } Forms.TApplication.Run (Line 7773, "Forms.pas" + 16) + $3
[00576DEF]{hfs244.exe  } hfs.hfs (Line 99, "" + 21) + $2

the bug is done by the line

procedure TmainFrm.Switchtovirtual1Click(Sender: TObject);
.......
f.setupImage(bakicon);

when replaced by f.icon:=icon;  then no bug is found ???


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
2.21MB?
debug version?

exactly.
when the exe is big, i get better error reports ;)

why are you rename the file by an external script when the macro rename does this job perfectly?

mars is right. why don't you use {.rename.} ?


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
The template installation macros are broken in this build. Also we have run into a problem, filelist.tpl is required for a dynamic template being worked on, and it is a lonely file that needs to be put next to hfs manually... we cant just auto-import filelist.tpl to the vfs like you can the 'template' folder.
« Last Edit: September 01, 2009, 07:27:55 AM by TSG »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
The template installation macros are broken in this build. Also we have run into a problem, filelist.tpl is required for a dynamic template being worked on, and it is a lonely file that needs to be put next to hfs manually... we cant just auto-import filelist.tpl to the vfs like you can the 'template' folder.

The template installation macros are NOT broken in this build. there is no change since the last build

I wonder that you do not have to think of creating the file of any part and to save it

Quote
[special:import]
{.set|filelist|
<html>
.....
</html>
%[file]%
....
%[folder]%
....
%[link]%
....
.}
{save|filelist.tpl|{.replace|%[|[|]%|]|{.^filelist.}.}|overwrite=true.}
{set|filelist|.}

It is so simple that even silentpliz managed to make it without me ;D

If any time it is not satisfactory, not kept silent can always ask Richard ... :D
Quote from:  From TSG with link
If you ask Richard for a release date he says 2011  but I think we'll have something working by the end of the year.

one other solution

Quote
[special:import]
.......
{comment| And at the end of the section.}
{.save|filelist.tpl|{.load|/template/filelist.tpl.}|overwrite=true.}

« Last Edit: September 01, 2009, 01:31:28 PM by Mars »


Offline Caco

  • Tireless poster
  • ****
    • Posts: 113
    • View Profile
One minor bug.

Remember the "persistent menu" bug i noticed sometime ago? Is the same for the "connection menu". You know that when HFS manages a new transfer it opens up a new tray icon for that connection. If you right click on it, a menu appears with options to kick, ban etc. If you decide to take no action and click on your desktop to make the menu disappear, it won't disappear.


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
The template installation is broken, otherwise I wouldn't have posted about it. It does not import the folder even with a fresh HFS, therefore, broken. I had to downgrade to 243 and it suddenly worked no problems.

And the thing about filelist.tpl isn't for me, it is for a template a colleague of mine is working on. It will just be convenient if we can also import files as well as folders in [special:import]. Also, I wanted rejetto to confirm that having filelist.tpl in the root of HFS, from any directory on the computer, will work as well as the automatic use of it next to HFS. It is all for the convenience of our users. I do not like hacks, because they are not permanent solutions. I do not have the time anymore to muck around with such things.

The template is not being worked on directly by RAWR-Designs but it might pass into our hands when it is ready, it is turning into something very cool. It is a surprise, one of the authors will be a familiar name to HFS users from a few years back ;) but I am not allowed to say anymore.

Something like this maybe?
Code: [Select]
[special:import]
{.add folder|real|template.}
{.set item|/template|hide=1.}
{.set item|/template|no log=1.}
{.add file|filelist.tpl.}
{.set item|/filelist.tpl|hide=1.}
{.set item|/filelist.tpl|no log=1.}
« Last Edit: September 01, 2009, 03:17:45 PM by TSG »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
remember you that filelist.tpl is always loaded from the directory of hfs.exe, never from the vfs, you cannot specify a path to filelist.tpl, you have to create or overwrite it in  hfs.exe folder, directly ;)

Quote
 // please note: we accept also ~files.lst.m3u
  if ansiStartsStr('~files.lst', urlCmd)
  or f.isFolder() and (data.urlvars.values['tpl'] = 'list') then
    begin
    s:=cfgPath+FILELIST_TPL_FILE;
    if newMtime(s, lastFilelistTpl) then
      filelistTpl.fullText:=loadfile(s);

    if not fileExists(s) and (lastFilelistTpl > 0) then
      begin
      lastFilelistTpl:=0;
     filelistTpl.fullText:=getRes('filelistTpl');
      end;

it is not possible to change the load-path of filelist.tpl , BY SECURITY ;)

Quote
[special:import]
{.add folder|real|template.}
{.set item|/template|hide=1.}
{.set item|/template|no log=1.}
{.save|c:\hfs\filelist.tpl|{.load|/template/filelist.tpl.}|overwrite=true.}
« Last Edit: September 01, 2009, 03:29:11 PM by Mars »


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
two similar bugs have been reprted by FRENCH CANCAN and TSG

Using the macro 'ADD TO FOLDER'  is broken in section [special:import]

corrected file hfs.exe HERE

to correct this bug, it is necessary to correct main.pas as

Quote
function Tmainfrm.findFilebyURL(url:string; root:Tfile=NIL):Tfile;
......
if root.isTemp() then
  begin
  workTheRestByReal(url, root);
  exit;
  end;
cur:=root.node;    // this line can create an exeption error withcur=NIL and n:=cur.getFirstChild();
if cur=NIL then exit;    //bug corrected by mars  preserve us from an exception error

while url > '' do
  begin
  s:=chop('/', url);
......

the second is an update inside the procedure addfolder()

Quote
 procedure addFolder();
  .......
  begin
  result:='';
  if not stringExists(p, ['real','virtual']) then exit;

  parent:=NIL;
  if assigned(md.folder) then
    parent:=md.folder.node;

  s:=par(1);
  if (s='') or ansiStartsStr('overwrite=',lowercase(s)) then exit; //add by mars bug detected when macro used with bad syntax
  if p = 'virtual' then
    begin
    if not validVFSpath(s) then exit;
    f:=Tfile.createVirtualFolder(s);
    end
  else
    begin
    if not isAbsolutePath(s) and assigned(md.folder) then
      begin
      s:=md.folder.resource+'\'+xtpl(s,['/','\','\\','\']);  //add by mars
      if ansicontainsStr(s,'\..') or ansicontainsStr(s,'..\') then exit; //mod by mars
      s:=expandFileName(s);  //mod by mars
      if not directoryExists(s) then exit;
      end;
    f:=Tfile.create(s);
    s:=par(2);
    if validVFSpath(s) and not ansiStartsStr('overwrite=',lowercase(s)) then  //mod by mars
      f.name:=s;
    end;

  old:=mainfrm.findFilebyURL(f.name, md.folder);  //was create an error exception
  if assigned(old) then
    if not parexist(['overwrite']) or isTrue(par('overwrite')) then
      try old.node.delete() except end // delete existing one
    else
      begin
      f.free;
      spaceIf(FALSE);
      exit;
      end;

  if mainfrm.addFile(f, parent, TRUE) = NIL then
    f.free
  else
    spaceIf(TRUE)
  end; // addFolder

 usage:
 {.add to folder|real|absolute-path|vfs-name.}  vfs-name created only if the path is valid on hard drive
 {.add to folder|real|absolute-path|VFS-name|overwrite=true.}  if one vfs-name exist in the vfs then he is deleted and the new created exept if overwrite=0

other possibilities
[special:import]  //french cancan
 {.add folder|real|..} when new name is ommited , this add the folder name where is stored the new tpl file
 {.add folder|real|.} is not a valid macro
 {.add folder|real|.||overwrite=0.} same as above but by preserve the existing folder.

by security , if an absolute path contain \.. ,then the macro is aborted: {.add folder|real|..|.} is not a valid macro

if in this case the name is not specified, and when 'overwrite=...'   is detected as par(2), then the name is empty.
 {.add folder|real|.|overwrite=true.} is a valid macro with no name  ;)

[special:import]  //tsg
{.add folder|real|template.}
{.set item|/template|hide=1.}
{.set item|/template|no log=1.}
{.add file|filelist.tpl.}
{.set item|/filelist.tpl|hide=1.}
{.set item|/filelist.tpl|no log=1.}

does work with the update.
« Last Edit: September 03, 2009, 11:10:47 PM by Mars »


Offline FRENCH CAN CAN

  • Tireless poster
  • ****
    • Posts: 681
    • View Profile
{.add folder|real|.|overwrite=true.}

Questa soluzione funziona su "hfs244Mars" ma NON SOVRASCRIVE la cartella di uguale nome se trovata.

Mi serve una soluzione che SOVRASCRIVE VERAMENTE la cartella di uguale nome, vedi tu. Ciao, French. ;)

----------------------------------------------------------------------------------------------------

This solution works on "hfs244Mars" but does not overwrite the folder of the same name if found.

I REALLY need a solution to overwrite the folder of the same name, see you. Hello, French. ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
The template installation macros are broken in this build. Also we have run into a problem, filelist.tpl is required for a dynamic template being worked on, and it is a lonely file that needs to be put next to hfs manually... we cant just auto-import filelist.tpl to the vfs like you can the 'template' folder.

it's a bug in {.add folder.}
fixed in next build.
@mars, it's because findFilebyURL() work on the VFS, while the parameter md.folder is not part of the VFS.

function Tmainfrm.findFilebyURL(url:string; root:Tfile=NIL):Tfile;
......
cur:=root.node;    // this line can create an exeption error withcur=NIL and n:=cur.getFirstChild();
if cur=NIL then exit;    //bug corrected by mars  preserve us from an exception error
while url > '' do

nice suggestion.
but since 'cur' changes in the loop, i included the check in the loop test.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Also, I wanted rejetto to confirm that having filelist.tpl in the root of HFS, from any directory on the computer, will work as well as the automatic use of it next to HFS.

the VFS is about "published" files.
it makes no sense to publish a configuration file.
this may be enough
{.copy|%folder-resource%\filelist.tpl|..}
consider also renaming first any existing file, as a backup

And the thing about filelist.tpl isn't for me, it is for a template a colleague of mine is working on. It will just be convenient if we can also import files as well as folders in [special:import].

if it's for the filelist.tpl, we should not consider it