Saturday, April 23, 2011

Device Discovery via Inquiry / filename functions in linux


  • I'm learning the concepts required to understand discovery inquiries.


[caption id="attachment_243" align="aligncenter" width="300" caption="Device Discovery via Inquiry"][/caption]

  • I discovered some pretty neat functions to get a file path in the most used formats, you could do that also with regular expressions, but hey, why to reinvent the wheel?


http://linux.die.net/man/3/filename

which helped me to open my pdf files with foxit reader in linux by double clicking on them. I like foxit reader even though I have to use wine, because is fast and among other interesting features, lets me highlight my documents using the free version.

[sourcecode language="bash"]

#!/bin/bash
dir=$(dirname $1)
cd $dir
base=$(basename $1)
wine /opt/foxit/FoxitReader431_enu_Setup.exe $base

[/sourcecode]

this little script gets called each time I click on a pdf. Weird thing that foxit with wine cannot open directly a file when is given its absolute path, so you move to the directory where the file is located and then you launch it by with its base name.

  • Too good to be true....my OpenSUSE is owned by Microsoft (in practical terms), it sucks.



  • I'm learning python, but I don't know enough to make something interesting...yet.


Gosh, I can't get to sleep.

No comments:

Post a Comment