chiark / gitweb /
Further ALSA underrun fiddling.
[disorder] / clients / filename-bytes.c
CommitLineData
460b9539 1/* Grotty program to print out the bytes making up filenames in some
2 * directory */
3
4#include "config.h"
5
6#include <dirent.h>
7#include <stdio.h>
8#include <ctype.h>
9
10int main(int attribute((unused)) argc, char **argv) {
11 DIR *dp;
12 struct dirent *de;
13 int n;
14
15 if(!(dp = opendir(argv[1]))) return -1;
16 while((de = readdir(dp))) {
17 for(n = 0; de->d_name[n]; ++n) {
18 printf("%02x", (unsigned char)de->d_name[n]);
19 if(n) putchar(' ');
20 }
21 putchar('\n');
22 for(n = 0; de->d_name[n]; ++n) {
23 if(isprint((unsigned char)de->d_name[n]))
24 printf(" %c", (unsigned char)de->d_name[n]);
25 else
26 printf(" ");
27 if(n) putchar(' ');
28 }
29 putchar('\n');
30 }
31 return 0;
32}
33
34/*
35Local Variables:
36c-basic-offset:2
37comment-column:40
38fill-column:79
39indent-tabs-mode:nil
40End:
41*/