Skip to content

Instantly share code, notes, and snippets.

@sinfu
Created October 5, 2010 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinfu/612405 to your computer and use it in GitHub Desktop.
Save sinfu/612405 to your computer and use it in GitHub Desktop.
|
| $f = new IO::File "test-dat.txt", "r+";
|
open("test-dat.txt",O_RDWR,00) = 3 (0x3)
ioctl(3,TIOCGETA,0xbfbfe6d0) ERR#25 'Inappropriate ioctl for device'
lseek(3,0x0,SEEK_CUR) = 0 (0x0)
fstat(3,{ mode=-rw-r----- ,inode=6335544,size=12,blksize=16384 }) = 0 (0x0)
fcntl(3,F_SETFD,FD_CLOEXEC) = 0 (0x0)
|
| read $f, $s, 2;
|
read(3,"0123456789##",4096) = 12 (0xc)
lseek(3,0x2,SEEK_SET) = 2 (0x2)
|
| print $f "x";
| print $f "y";
|
lseek(3,0x0,SEEK_CUR) = 2 (0x2)
write(3,"xy",2) = 2 (0x2)
|
| read $f, $s, 4;
|
read(3,"456789##",4096) = 8 (0x8)
lseek(3,0x8,SEEK_SET) = 8 (0x8)
|
| print $f "zz";
|
lseek(3,0x0,SEEK_CUR) = 8 (0x8)
write(3,"zz",2) = 2 (0x2)
|
| read $f, $s, 2;
|
read(3,"##",4096) = 2 (0x2)
close(3) = 0 (0x0)
@sinfu
Copy link
Author

sinfu commented Oct 5, 2010

"test-dat.txt" の内容はきっちり12バイト "0123456789##"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment