Created
January 27, 2011 09:26
-
-
Save niklasfi/798283 to your computer and use it in GitHub Desktop.
c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _XOPEN_SOURCE 500 | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
int main(){ | |
char* ds=new char[10]; | |
for(unsigned int i = 0 ; i<10;i++) | |
ds[i]=65; | |
int fd = open("./f",O_WRONLY , 666); | |
int ssize = pwrite(fd, ds, 10,10); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
var b = Buffer('AAAAAAAAAA'); | |
fs.open('./f','w', '666' , function(err, fd){ | |
fs.write(fd,b,0,10,10) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment