Skip to content

Instantly share code, notes, and snippets.

@thcipriani
Last active April 12, 2018 20:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thcipriani/6c8c7b13fe31df644bd8b7f8ee52b383 to your computer and use it in GitHub Desktop.
Save thcipriani/6c8c7b13fe31df644bd8b7f8ee52b383 to your computer and use it in GitHub Desktop.
<?php
$fp = fopen('/home/thcipriani/test.txt', 'w');
fwrite($fp, 'hello');
fwrite($fp, ' ');
fwrite($fp, 'world');
fwrite($fp, "\n");
fclose($fp);
14371 open("/home/thcipriani/test.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 8
14371 lseek(8, 0, SEEK_CUR) = 0
14371 lseek(8, 0, SEEK_SET) = 0
14371 write(8, "hello", 5) = 5
14371 lseek(8, 0, SEEK_CUR) = 5
14371 lseek(8, 5, SEEK_SET) = 5
14371 write(8, " ", 1) = 1
14371 lseek(8, 0, SEEK_CUR) = 6
14371 lseek(8, 6, SEEK_SET) = 6
14371 write(8, "world", 5) = 5
14371 lseek(8, 0, SEEK_CUR) = 11
14371 lseek(8, 11, SEEK_SET) = 11
14371 write(8, "\n", 1) = 1
14371 close(8) = 0
14404 open("/home/thcipriani/test.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
14404 fstat(4, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
14404 lseek(4, 0, SEEK_CUR) = 0
14404 write(4, "hello", 5) = 5
14404 write(4, " ", 1) = 1
14404 write(4, "world", 5) = 5
14404 write(4, "\n", 1) = 1
14404 close(4) = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment