View Single Post
Old 05-27-2015, 10:40 AM  
bigstar
FlashFXP Developer
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

Quote:
Originally Posted by DayCuts View Post
I would second the /loadqueue /savequeue suggestion, it would be useful to be able to manipulate a queue file using a custom command. I was just wondering about this the other day. I see I can use cli switches to automate queue manipulation but I have yet to test have efficiently it can be done as I have not had the time.
I will add the following commands to the next build.
/loadqueue <filename>
/savequeue <filename>

Quote:
Originally Posted by DayCuts View Post
I am wondering if the -raw cli switch can launch a custom command such as -raw="/mycmd" so one could do for example...

flashfxp.exe "SITE1" -pass="" -lock -quit -queue="queuefile" -savequeue -raw="/updatequeuefile"

or with the potential load/save queue commands...

flashfxp.exe "SITE1" -pass="" -lock -quit -raw="/updatequeuefileX"
This is a very interesting idea.

You would need to pass the predefined command to be performed as a command block "[updatequeuefileX]"

After performing some tests I discovered some limitations with the current design that would prevent this from working.

When you use the -raw switch it creates a queue entry to execute the command, this entry is added after the queue file is loaded, placing it at the end of the queue. (The switch order has no relevance)

I can change this behavior so that the raw command is always inserted into the top of the queue to execute first.

But now we have another problem, since the raw command is executed via the queue we need a way to stop it immediately after the last command is executed, if we use the /stop command to abort the queue then we introduce a new problem that prevents us from automatically closing flashfxp via the -quit switch. additional changes would be needed to make this work.

I will need to continue evaluating this idea to see if it can be done without making things overly complicated.

Quote:
Originally Posted by DayCuts View Post
I know I am going OT here but I was also wondering if their were any plans to extend the -id cli switch, such as allowing -raw actions to be appended if the ID session is still active. For example if multiple external sources launch flashfxp via cli to perform simple raw commands they don't need to spawn new sessions if there is say a session with id "RAWCMS" already open...

flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmd2"
flashfxp.exe -id="RAWCMDS" -pass="" -lock -quit -raw="somecmdN"

If they are triggered to run at different times or events then currently you have to spawn and close sessions each time. You could write a queue file and use the -id -queue support but it is not necessarily efficient or desirable to be writing/deleting temporary files.
Since a raw command passed via the CLI is transformed into a queue item which gets added to the queue anyways I think it might be more practical using a temporary queue file.

Also in my answer to your previous question I talked about changing -raw to insert the command at the top of the queue, that change would cause commands to be executed in the wrong order if something like this was allowed.

Oh and you would also need to pass the site name via the CLI which is missing from your example above
(I suspect a slight oversight on your post)
bigstar is offline