rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - newbie

Pages: 1 2 3
31
HFS ~ HTTP File Server / Firing an event on macro completion
« on: October 22, 2019, 08:40:51 PM »
I would like to fire an event to do something (for e.g run exec) when a template script in my DiffTemplates finishes successfully.

For e.g: when exec |myprog.exe| runs and produces a file.ext, then fire an event that will then call another exec to do something with the file.
ie the appearance of the file constitutes an event, upon which some other process works on that file.

I looked at this https://rejetto.com/wiki/index.php?title=HFS:_Event_scripts#Other_events and searched in the forum, but it isnt clear to me how I can fire up my own event and watch for it.

I would really appreciate any help.

Thanks.


32
HFS ~ HTTP File Server / Deploy HFS configuration across various machines
« on: October 22, 2019, 07:31:53 PM »
Hi,
I would like to deploy my current HFS setup across various machines via cmdline.
https://rejetto.com/wiki/index.php?title=HFS:_Command_line_parameters

My setup has a user-password, specific permissions & DiffTemplates, and there isnt any fixed path between different machines...ie the only constant is that the data folder will be relative to hfs.exe.

I have tried the following:
1. F:\HFS\hfs.exe -a myhfs.ini F:\HFS\myData
This adds the myData  folder alright, but it doesnt have any of the permissions or DiffTemplates.

2. After saving the vfs to a myHFS.vfs, I tried
D:\Blah1\Blah2\Blah3\HFS\hfs.exe -a D:\Blah1\Blah2\Blah3\HFS\myHFS.vfs
It doesnt work, when run on a machine that doesnt have an F: drive.
It only works on the original machine since an inspection of the vfs shows that the path is hardwired to F:\HFS\myData

Is there any way to do this?

Thanks.

33
HFS ~ HTTP File Server / Re: Macro support for symbolic folders
« on: October 11, 2019, 01:23:16 PM »
Sweet! That worked. Thanks for (all) your help Mars.

34
HFS ~ HTTP File Server / Re: Macro support for symbolic folders
« on: October 10, 2019, 01:20:06 PM »
Thank you Mars.

So, this snippet didnt work:
{.set|cmd|{fsutil reparsepoint query {.^x.}| find "Symbolic Link" > nul && echo symlink || echo notsymlink}.}
{.exec|{.^cmd.}|out=#output.}
{.^#output.}

but when I moved the fsutil to a windows.bat file (like the following), it did what I wanted to do:
{.exec|CheckSymlink.bat {.^x.}|out=#output.}
{.^#output.}
So, I'm guessing I messed up the syntax of that exec line in the first snippet.

But, I have another question:
By the way, fsutil assumes the "TestSymFolder" folder lives in the cwd where hfs.exe was executed from.
My HFS env is this:
F:\TestHFS\data is published to <HFS>/test/
F:\TestHFS\data\TestSymFolder is the symbolic linked folder which I am querying.

When I call force ansi
{.set|x|{.force ansi|%folder%{.^x.}.}.}
& use that with fsutil, the folder isnt found cause fsutil is looking at /test/TestSymFolder at the root of the F: drive.

Q: So, is there a macro to get the fully-qualified path to the root of the shared HFS folder i.e F:\TestHFS\data
so that I can supply fsutil with a path like: <FQPath>/TestSymFolder

Thank you.

35
HFS ~ HTTP File Server / Re: Macro support for symbolic folders
« on: October 09, 2019, 03:10:58 PM »
Thanks for responding Mars.

external program? Ok. like the following e.g?

If I type this in a cmd prompt:
fsutil reparsepoint query TestSymFolder | find "Symbolic Link" > nul && echo symlink || echo notsymlink


then it returns back the output:
symlink

Then, how would I call fsutil in the following macro that goes into Properties:DiffTemplate:

[ajax.getfileattr|no log]
{.check session.}
{.set|x|{.postvar|name.}.}
{.break|if={.pos|\|var=x.}{.pos|/|var=x.}|result=forbidden.}
{.set|x|{.force ansi|%folder%{.^x.}.}.}
{.break|if={.not|{.exists|{.^x.}.}.}|result=not found.}
{.break|EXEC FSUTIL && output==symlink | result=symlink.} <===SYNTAX?
{.break|if={.isfile|{.^x.}.}|result=file.}
{.add to log|User %user% get file attrs for "{.^x.}".}
{.pipe|folder.}

P.S:
Also, when my input is a non-symbolic-link folder, the above code returns "file".
Is something wrong with my syntax for this line:
{.break|if={.isfile|{.^x.}.}|result=file.}

36
HFS ~ HTTP File Server / Macro support for symbolic folders
« on: October 09, 2019, 02:32:17 PM »
Ref: https://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands
I see the following:
exists | A
checks A for existence, may it be a file or folder.
is file | A
checks A for existence as a file.

and I have been able to use them in Properties:DiffTemplate to check if something is a file or folder.

However, I have not been able to check if a folder is a symbolic link.
Is there a undoc'ed macro for that? Or some other way to do this.
Cause a Search of the forum shows lots of hits for "islink", but it looks like its src code from some .pas file.

Thanks.

37
HFS ~ HTTP File Server / Re: Executing HFS scripts from curl
« on: October 07, 2019, 03:23:52 PM »
Thank you Mars & SilentPliz for those links. Thats a lot of doc/information.

I have another question:
Does HFS support querying a path to check if its a:
- file
- folder
- symbolic link

And, if so how?

Thanks


38
HFS ~ HTTP File Server / Re: Executing HFS scripts from curl
« on: October 04, 2019, 01:43:24 PM »
DJ, Thanks for your response.

So,
This didnt work:
curl "http://localhost/test/?mode=section^&id=ajax.mkdir"  --data "name=Child"

but this did:
curl "http://localhost/test/?mode=section&id=ajax.mkdir"  --data "name=Child"
Note the lack of the character ^

I think this gives me a good start on the rest of my reqs. The mkdir was the easiest of my req.
I think the HFS & its scripting capabilities is a powerful tool, but it would be really helpful, if there is an example section in the documentation describing how to get started after settings up the HFS server.
And, I am not talking about just to doing it on curl. There is a lot of documentation & snippets on the forum, but it wasnt clear to me how to get started in the first place.

39
HFS ~ HTTP File Server / Executing HFS scripts from curl
« on: October 03, 2019, 03:10:29 PM »
Hello,
How do I execute a HFS script from curl.
For e.g to create a folder, the HFS:_scripting_commands doc says that I need to use the script: mkdir|foldername

So, how do I use it in curl. I am trying to create a folder called: hfsserver:port/Parent/Child

I tried:
curl -u user:passwd hfsserver:port/Parent/ -XPOST -d "{mkdir|Child}"
and it didnt work.

Thanks.

Pages: 1 2 3