Skip to content

Instantly share code, notes, and snippets.

@thcipriani thcipriani/1.testwrite.php Secret
Last active Apr 12, 2018

Embed
What would you like to do?
<?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
You can’t perform that action at this time.