Команда: sample
sfk sample java|cpp|... [outfile.java|.cpp|...]
print a short example code in a programming language.
supported parameters
sfk create a simple sfk script
sfkbat sfk script embedded in a .bat or .cmd
sfkbash sfk script embedded in a bash script
http automated http access example script
http -bat ... as a windows .bat file
http -bash ... as a linux .sh file
httpdata create a .zip file with webdemo files
for local use with sfk httpserv
cmd create generic windows .cmd or .bat file
bash create generic linux bash script
html simple html page with css and javascript
java create a java class doing text file I/O
javaimg create a java class doing image file I/O
javahex create a hexdump of binary data in java
javagui create a simple java gui application
cpp create a c++ text file I/O example
cppnetlog how to send UDP network text in C++
javanetlog how to send UDP network text in Java
php create command line php code for text I/O
phpimg create php example for image processing
options
-force if output file exists already, overwrite it.
command shortcut
sfk batch myscript.bat
does the same as "sfk samp sfkbat myscript.bat"
web reference
http://stahlworks.com/sfk-sample
more in the SFK Book
the SFK Book contains a 60 page tutorial, including
long sfk script examples with input, output and
detail explanations. type "sfk book" for more.
examples
sfk samp sfkbat foo.bat
creates batch file foo.bat with embedded sfk script.
type "foo.bat" to run the created script. note that
foo.bat must be created in a directory of your PATH,
or in the current directory.
sfk batch foo.bat -force
the same as above, and overwrites an existing file.
sfk batch foo.sh
create a bash script file, with lf only line endings.
can also be used under windows for mingw environments.
sfk samp java foo.java
create a java class foo. if the java JDK is available,
type "javac foo.java" and then "java foo" to run it.
sfk samp phpimg doimg.php
create image processing script that can be run by:
php doimg.php
if php.exe is in your PATH (read remarks in the script).
sfk samp javahex +toclip
copy example for java hexdump creation to the clipboard.
sfk samp http tmp.bat
create an example script for automated web/http access.
sfk samp http -bash tmp.sh
the same, but using bash in a Windows Cygwin environment.