Greetings, ye Monks of Perl.
I'm writing something that does a lot of readlink calls, and sometimes it returns some pretty strange stuff. I'm guessing the strangeness is actually coming from my operating system, but I wanted to share and see what you all thought.
Sometimes the returned string contains some non-printing characters followed by a bunch of pretty random looking stuff. Here's an example:
/proc/32433/exe -> /usr/bin/perl.pid]o_ff.jpg (deleted)
If I pipe that through less, I get to see markers showing me where the non-printing characters are:
/proc/32433/exe -> /usr/bin/perl^@.pid^@]^@^@o_ff.jpg (deleted)
An ordinary ls -l /proc/32433/exe says /proc/32433/exe -> /usr/bin/perl. I get the same by running the readlink command (/usr/bin/readlink).
So it looks like the correct answer followed by a bunch of other stuff.
If you're on linux, you can try this...
... and you might see what I'm talking about.find /proc -type l -name 'exe' | \ perl -n -e 'chomp($_); print "$_ -> ".readlink($_)."\n";'
Anybody know what's going on here?
I'm on CentOS 5.5 running perl 5.8.8 from the perl-5.8.8-32.el5_5.1 rpm package.
Thanks!
--Pileofrogs
In reply to readlink returning strange stuff by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |