my %dosname; for (`DIR`) { /^(.{8}) ([^ ]*).+?([^ ]+)\n$/ and ($dosname{$3} = $1 . (length $2 ? ".$2" : "")) =~ tr/ //d; } ## Usage: opendir(MYDIR, ".") or die "Could not opendir: $!\n"; while(defined ($_ = readdir(MYDIR))) { printf "%-12s : $_\n", $dosname{$_}; } closedir(MYDIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(crazyinsomniac) Re: Grabbing 8.3 DOS names
by crazyinsomniac (Prior) on Jan 21, 2001 at 19:05 UTC |