WHy does not java have canBeExecuted method in its File class

  • Thread starter Yadagiri Rao KP
  • Start date
Y

Yadagiri Rao KP

Why doesn't Java have canBeExecuted method in its File class unlike
WIndows and UNix files.PLs explain
 
T

Tor Iver Wilhelmsen

Why doesn't Java have canBeExecuted method in its File class unlike
WIndows and UNix files.PLs explain

Not all platforms have the ability to identify an "executable"
attribute of a file.
 
T

Tim Tyler

: (e-mail address removed) (Yadagiri Rao KP) wrote or quoted :

:>Why doesn't Java have canBeExecuted method in its File class unlike
:>WIndows and UNix files.PLs explain

: Tell us non-Unix types what this method does. Perhaps the reason is
: it would only have meaning on Unix platforms.

It could mean the system knows what to do with the file when the user
changes the CSD to its directory and types its name in at the prompt.
 
T

Tim Tyler

: (e-mail address removed) (Yadagiri Rao KP) writes:

:> Why doesn't Java have canBeExecuted method in its File class unlike
:> WIndows and UNix files.PLs explain

: Not all platforms have the ability to identify an "executable"
: attribute of a file.

Not all platforms can print. Not all platforms have colour screens.

If not all platforms support something, that is not sufficient reason
for Java not to support it.

Windows has a flag for marking executable files (Properties>
Security>Advanced).

Unix does also - I guess that covers Linux, Solaris and OSX as well.
 
R

Roedy Green

Not all platforms have the ability to identify an "executable"
attribute of a file.

windows itself does not have such an attribute bit. What determines if
something is executable is if there is a hook for the extension in the
registry. For example you can make .html executable in that clicking
an HTML file will execute the html by starting a browser and rendering
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top