ArOZ Online System File Explorer - Freeze Script Execution Application, design for replacing those script that was freezing the system while file IO.
|
пре 5 година | |
---|---|---|
log | пре 5 година | |
LICENSE | пре 5 година | |
README.md | пре 5 година | |
examples.txt | пре 5 година | |
fsexec.exe | пре 5 година | |
fsexec_amd64.elf | пре 5 година | |
fsexec_arm64.elf | пре 5 година | |
fsexec_armv6l.elf | пре 5 година | |
fsexec_i386.elf | пре 5 година | |
main.go | пре 5 година | |
title.png | пре 5 година | |
title.psd | пре 5 година |
ArOZ Online System File Explorer - Freeze Script Execution Application, design for replacing those script that was freezing the system while file IO.
Freeze Script Execution Application - Short for fsexec, is a binary written in golang to replace the old scripts in the ArOZ Online File System that would freeze the whole PHP server during file IO operations. This script make use of golang's super fast IO and processing ability and make file operation much faster on the new implementation.
The fsexec application will receive the command as two parts. In most case, you will be using these funcitons only.
./fsexec {uuid} {command}
where command is a string in base64 encoded JSON string.
For example, you want to use the funciton [copy] with paramter {source} and {target}.
First, you need to convert the command into an array and parse it as JSON string.
For example, you have the following command array:
["copy","./test.txt","target/test.txt"]
Next, you would want to stringify it as JSON string.
"[\"copy\",\"./test.txt\",\"target/test.txt\"]"
Then, you can convert the string above into base64 representation. This is what you will get:
WyJjb3B5IiwiLi90ZXN0LnR4dCIsInRhcmdldC90ZXN0LnR4dCJd
Lastly, you call the fsexec with the following command. Assumeing the {uuid} is [123]
./fsexec 123 WyJjb3B5IiwiLi90ZXN0LnR4dCIsInRhcmdldC90ZXN0LnR4dCJd
Here are some examples:
# copy test.txt test/test.txt
./fsexec uuid_string WyJjb3B5IiwidGVzdC50eHQiLCJmb2xkZXIvdGVzdC50eHQiXQ==
# copy_folder test/ target/test/
./fsexec uuid_string WyJjb3B5X2ZvbGRlciIsInRlc3QvIiwidGFyZ2V0L3Rlc3QvIl0=
The fsexec application will create a folder named "log" if it doesn't exists. Inside the log folder, you would found "done" and "error" sub-folders. In simple words:
As its name suggest, UUID is a unique string or interger that can be used to identify each file operations. You can use anything you want as soon as it is unique. Just to make sure don't use some wierd, not universal-supported characters.
CopyRight Author Toby Chui under ArOZ Online Project, 2019