* you can even name it my.jpg & it will execute your perl script

..... yes, the basic linux filesystem has file permissions..... not file extensions... to determine if a file is an executable..... this is far safer than extensions as you are beginning to find out..... you probably are coming from a MSWindow's background and need to learn more about the improved security of linux....

it probably is getting crazy for you, if you are running a dual boot with linux and windows..... then you will start seeing files from the Windows OS, that seem marked executable, or vice versa... or you do alot of double-clicking on icons and expect the system to do what you want".. :-)

.... the way it works on linux is:

....you instruct your shell to execute a program, and regardless of it's name it will see if its marked as executable by you or your group..... if it is...it tries to execute it.... but if you try to execute a jpg or bmp.... it won't run....and will just return an error...... and then there are the shebang lines :-)....... maybe read linux programming... and the Rute User's Guide

...that brings us to default programs and apps which will properly load your file....its a part of your system setup....ubuntu uses the Gnome Desktop to determine file types thru a MIME-information setup..... first look for extension....then check type with a file-like command

...this is all getting to the point of you needing to read up on linux....it isn't a Perl problem

...see monitor suid and world writtable files for an example of checking perms.....

....also on ubuntu....try installing the program Midnight Commander, go thru it's menus and see what info is tracked on files

I have many images saved without extensions ... and it works that way.

...sure it does..... but that is because the Ubuntu Desktop handles it all for you..... as a matter of fact, your only problem may be that you have a destop setting set to hide file extensions, like they do on Winblows

why don't you right-click on those images and get the info?...... are you trying to automatically rename something like the browser's cache of images? :-) which are named like numbers?

..... you need to learn how Desktops work...... it's actually a program that has MIME type records built in..... go see MIME modules for Perl


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku

In reply to Re^3: Answer: How do I find the type of an image? by zentara
in thread How do I find the type of an image? by ahmad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.