Skip to content

Instantly share code, notes, and snippets.

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