Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
1
Task/Hostname/AppleScript/hostname.applescript
Normal file
1
Task/Hostname/AppleScript/hostname.applescript
Normal file
|
|
@ -0,0 +1 @@
|
|||
host name of (system info)
|
||||
1
Task/Hostname/Batch-File/hostname.bat
Normal file
1
Task/Hostname/Batch-File/hostname.bat
Normal file
|
|
@ -0,0 +1 @@
|
|||
hostname
|
||||
|
|
@ -1 +1,2 @@
|
|||
USE: io.sockets
|
||||
host-name
|
||||
|
|
|
|||
19
Task/Hostname/Haskell/hostname-2.hs
Normal file
19
Task/Hostname/Haskell/hostname-2.hs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module GetHostName where
|
||||
|
||||
import Foreign.Marshal.Array ( allocaArray0, peekArray0 )
|
||||
import Foreign.C.Types ( CInt(..), CSize(..) )
|
||||
import Foreign.C.String ( CString, peekCString )
|
||||
import Foreign.C.Error ( throwErrnoIfMinus1_ )
|
||||
|
||||
getHostName :: IO String
|
||||
getHostName = do
|
||||
let size = 256
|
||||
allocaArray0 size $ \ cstr -> do
|
||||
throwErrnoIfMinus1_ "getHostName" $ c_gethostname cstr (fromIntegral size)
|
||||
peekCString cstr
|
||||
|
||||
foreign import ccall "gethostname"
|
||||
c_gethostname :: CString -> CSize -> IO CInt
|
||||
|
||||
main = do hostName <- getHostName
|
||||
putStrLn hostName
|
||||
7
Task/Hostname/Oberon-2/hostname.oberon-2
Normal file
7
Task/Hostname/Oberon-2/hostname.oberon-2
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
MODULE HostName;
|
||||
IMPORT
|
||||
OS:ProcessParameters,
|
||||
Out;
|
||||
BEGIN
|
||||
Out.Object("Host: " + ProcessParameters.GetEnv("HOSTNAME"));Out.Ln
|
||||
END HostName.
|
||||
1
Task/Hostname/Vim-Script/hostname.vim
Normal file
1
Task/Hostname/Vim-Script/hostname.vim
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo hostname()
|
||||
Loading…
Add table
Add a link
Reference in a new issue