
June 9th, 2003, 07:45 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Something like this maybe:
Code:
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
struct stat sb;
char buf[4]="hda";
char path[100];
char c;
char cmd[100];
for (c='a'; c <='z'; c++) {
buf[2] = c;
sprintf(path, "/proc/ide/%s", buf);
if (stat(path, &sb) == 0) {
sprintf(cmd, "hdparm -c1 -d1 -m16 /dev/%s > /dev/null", buf);
system(cmd);
}
}
return 0;
}
Hope this helps 
|