This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/as3shebang -- | |
/* Note: | |
mkdir() creates directoy | |
but can not creates directory tree | |
the command line "$ mkdir -p" allows that | |
so here a small util function to emulate that | |
behaviour | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/as3shebang -- | |
// see http://en.wikipedia.org/wiki/ANSI_escape_code | |
package ansi | |
{ | |
import flash.utils.describeType; | |
import shell.Program; | |
public class controls | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/as3shebang -- | |
/* Note: | |
Again the joy of using POSIX from AS3 :p | |
see: | |
Copy a file in an sane, safe and efficient way | |
http://stackoverflow.com/questions/10195343/copy-a-file-in-an-sane-safe-and-efficient-way | |
BUFSIZ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
import C.stdio.*; | |
import flash.utils.ByteArray; | |
function write( message:String = "" ):void | |
{ | |
var bytes:ByteArray = new ByteArray(); | |
bytes.writeUTFBytes( message ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import C.stdio.*; | |
import flash.utils.ByteArray; | |
import shell.FileSystem; | |
import shell.Program; | |
/* NOTE: | |
trace() add a carriage return | |
better use Program.write() to | |
control exactly the char return at end of line | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* build: | |
import redbean.*; | |
import shell.FileSystem; | |
compile( "src/index.as" ); | |
if( FileSystem.exists( "index.abc" ) ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* build: | |
import redbean.*; | |
import shell.FileSystem; | |
compile( "src/index.as" ); | |
if( FileSystem.exists( "index.abc" ) ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import C.errno.*; | |
import C.arpa.inet.*; | |
import C.netdb.*; | |
import C.sys.socket.*; | |
import C.stdlib.*; | |
import C.unistd.*; | |
var hostname:String = gethostname(); | |
trace( "hostname = " + hostname ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import C.errno.*; | |
import C.arpa.inet.*; | |
import C.netdb.*; | |
import C.sys.socket.*; | |
import C.stdlib.*; | |
import C.unistd.*; | |
var hostname:String = "www.google.com"; | |
trace( "hostname = " + hostname ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
struct addrinfo hints, *res; | |
int sockfd; | |
memset(&hints, 0, sizeof hints); | |
hints.ai_family = AF_INET; | |
hints.ai_socktype = SOCK_STREAM; | |
hints.ai_flags = AI_PASSIVE; | |
int result = getaddrinfo(NULL, "3490", &hints, &res); |