std.path.getName(): Screwy by design?
Nick Sabalausky
a at a.a
Thu Mar 3 13:54:07 PST 2011
On Thu, 03 Mar 2011 21:47:54 +0300, Jérôme M. Berger <jeberger at free.fr>
wrote:
> Kagamin wrote:
>> Don Wrote:
>>
>>> ??????
>>> It ALWAYS makes a difference. For example, only .exe and .com files are
>>> executable.
>>> On unix, the filename is just a name. Nothing more. By contrast, the
>>> Windows extension actually matters. They're completely different.
>>
>> What do you mean? You can run .js and .vbs files as well.
>> It was posted here already, you can rename an .exe to .txt and run it
>> from console.
I just tried that and it does work. Weird.
>
> No you cannot. What happens is that you *open* them with the
> default application, which just happens to be an interpreter whose
> default action is to run the script.
That still doesn't imply that the dot and extention aren't part of the
filename on windows. Which was my original point: the dot and extension ARE
part of the filename on *both* unix and windows. Might not have been the
case back on MS-DOS 6, but something like XP, yea. The fact that sometimes
parts of the system actually pay attention to that particular *part of the
filename* doesn't change the fact that it's still part of the filename. And
besides, from what I've heard, even in unix there are times when the
extension does get checked.
> Try renaming a .exe into .js
> and it will not run, whereas on Unix it would.
>
Works for me from the console.
More information about the Digitalmars-d
mailing list