Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Im in your hdd adding null bytz

Name: Anonymous 2007-02-04 9:50

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv) {
   
    FILE *fp;
    int i = 0;
    long bytes, filesize;
   
    if(argc != 3) {
        fprintf(stderr, "Usage: %s [file] [bytes to write]\n", argv[0]);
        exit (1);
    }
   
    fp = fopen(argv[1], "a");
   
    if(!fp) {
        fprintf(stderr, "Error: Cant write to %s\n", argv[1]);
        exit (2);
    }
   
    bytes = atoi(argv[2]);
   
    if((isdigit(bytes)) || (bytes <= 0)) {
        fprintf(stderr, "Error: %s is not a valid number of bytes\n", argv[2]);
        fclose(fp);
        exit (3);
    }
   
    fseek(fp, 1, SEEK_END);
    filesize = ftell(fp);
    rewind(fp);
   
    printf("size of %s: %ld\nBytes to add: %ld\n", argv[1], filesize, bytes);
   
    while(bytes--) {
        fputc(0, fp);
        i++;
    }
   
    fseek(fp, 1, SEEK_END);
    filesize = ftell(fp);
    fclose(fp);
   
    printf("size of %s: %ld\n", argv[1], filesize);
}

Name: Anonymous 2007-02-04 9:52

Misterious intiger i there.

Name: Anonymous 2007-02-04 9:53 (sage)

Shitty code and coding style.

Name: Anonymous 2007-02-04 10:23

how is it shitty?

Name: Anonymous 2007-02-04 10:30

>>4
It's C.

Name: Anonymous 2007-02-04 10:38

Lunix Tarballs finally switched over to Linux (from Minix) after his modem dialled his hard disk and spewed randomness all over it. True story.

Name: Anonymous 2007-02-04 10:47

>>5
and C is the best language ever.
i don't see where this is going

Name: Anonymous 2007-02-04 11:02

>>7
lol.. so confused

Name: Anonymous 2007-02-04 11:08

>>8

gb2sun java idiot

Name: Anonymous 2007-02-05 1:57

hey guys lets all get along and make JAVAC#BASIC++TRANPYTHONPASCAL the true prgramrmeing langauge lollo ^____________^

Name: Anonymous 2007-02-05 5:23

>>1

That is a compeltely shit way of doing this

Name: Anonymous 2007-02-05 5:59

>>11
post a bettter one then

Name: Anonymous 2007-02-05 6:07

>>12
dd if=/dev/zero of=/dev/hda bs=4096

Name: Anonymous 2007-02-05 6:12

>>13
Actually that's slower than my way.

Name: Anonymous 2009-01-14 14:09

lol tripfags

Name: Anonymous 2009-07-12 7:19

their  have able able on you of some for i be  Use ssh and over, sort RA, A. 25K an work RA, 12 A. servers printf("%i",   ((Cons &amp;bar; (*(int &amp;foobar; *)((Cons &amp;foo2;

Name: Anonymous 2010-06-25 14:49

WARNING: NECRO POST

Name: Sgt.Kabu羌ᤉkimanፀ 2012-05-28 22:21

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List