Tauno Voipio <[EMAIL PROTECTED]> writes: > Pascal Bourguignon wrote: > >> In unix, disks are files like any other file. So if your programming >> language allows you to read and write files, it allows you to read and >> write disks. >> Just write the equivalent of: >> int fd=open("/dev/hda",O_RDWR,0); >> if(0<==fd){ >> check_errors(lseek(fd,SECT_SIZE*sect_num,SEEK_SET)); >> check_errors(read(fd,buffer,SECT_SIZE)); >> modify(buffer); >> check_errors(lseek(fd,SECT_SIZE*sect_num,SEEK_SET)); >> check_errors(write(fd,buffer,SECT_SIZE)); close(fd); } >> and be sure to have the access rights on /dev/hda (and to know what >> you're doing!). > > This means in practice that your program has to run > with root rights to handle complete disks or partitions.
Not necessarily. We can see things like: chown oracle /dev/hdc > Are you attempting to create a boot block virus? I suppose that's what he is, in python... -- __Pascal Bourguignon__ http://www.informatimago.com/ The mighty hunter Returns with gifts of plump birds, Your foot just squashed one. -- http://mail.python.org/mailman/listinfo/python-list