Shranimo jih lahko kot int
STDIN_FILENO: stdinSTDOUT_FILENO: stdout
Ali po imenu datoteke:
int deskriptor = open("pot/ime", {dovoljenje}) // vrne deskriptor
| void drawLine(x1, y1, x2, y2) { | |
| ctx.beginPath(); | |
| ctx.moveTo(x1, y1); | |
| ctx.lineTo(x2, y2); | |
| ctx.stroke(); | |
| } | |
| double tanDeg(num x) { | |
| return tan(x * PI/180); | |
| } |
| function info { | |
| if [[ -n "$1" ]]; then | |
| OIFS=$IFS | |
| IFS=':' read -a user <<< "$(getent passwd $1)" | |
| if [[ "${user[0]}" != "$1" ]]; then | |
| echo "$1: err" | |
| else | |
| printVals=() | |
| if ((${user[2]} == ${user[3]})); then | |
| printVals+=("enaka") |
| #include <sys/file.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #define E_O_I "odpiranju vhodne" | |
| #define E_L_I "zaklepanju vhodne" | |
| #define E_UL_I "odklepanju vhodne" |
"" == 0 is true, 0 == "0" is true, but "" == "0" is false (by Felix Gessert on Quora)
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| #!/bin/bash | |
| function help { | |
| echo -en "\033cPritisnite: | |
| q - izhod iz programa (quit) | |
| h - izpiše pomoč in čaka na pritisk tipke (help) | |
| c - menjava vidnosti izpisa ukaza (command toggle display) | |
| m - menjava vidnosti izpisa porabe pomnilnika (memory toggle display) | |
| p - menjava vidnosti izpisa zasedenosti cpu (cpu toggle display) | |
| u - menjava izpisa uporabnika (user toggle display) |
| #!/bin/bash | |
| # Napišite skripto streznik.sh, ki bo komunicirala s svetom preko | |
| # imenovane cevi streznik.cev. Na to cev lahko drugi procesi pošiljajo | |
| # ukaze strežniku: | |
| # - connect ime_cevi (povezovanje, podano je ime cevi, kamor naj strežnik pošilja odgovore) | |
| # - add N1 N2 N3 N4 ... (seštej podana števila) | |
| # - mult N1 N2 N3 N4 ... (zmnoži podana števila) | |
| # - disconnect (odklopi se od strežnika) |