Re: need native call help

[email protected] (Todd Chester via perl6-users)
Newsgroups perl.perl6.users
Message-ID <[email protected]>

On 4/18/24 04:50, yary wrote:
> I did a lot of very deep windows programming in my previous job and 
> reminding me that I would always use the 8.3 short name for file 
> operations! dir /x will get it for you. Must be API called for it also. 
> Probably only works on local volumes not network rounded ones. Just a guess.

AreShortNamesEnabled function (fileapi.h)
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-areshortnamesenabled

and

GetShortPathNameW function (fileapi.h)
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew

The silly "W" at the above means you have to convert your
string to UTF16.  If yo have a "A" at the end, you can
just use UTF8.  I have modules for to convert both the them.

> 
> I've run into problems on some unix shells with maximum command-line 
> lengths.
> 
> -y
> 

Hi Yary,

The 64 thousand dollar questions is should
the programming language make allowances for
the "quirks" of an operating system, such as the
260 file limit DeleteFileA, and just presume the
user of the programming language has no business
programming for the particular operating system
if he does not already know the quirks or should
the programming language make allowances?

As for me, when I throw unlink at a file, I expect it
to work or at least be told why not.  So, I think
allowances show be made.

In my DeleteFileA module, I obviously wanted it
to just work, quirks or no quirks, so I could just
go about deleting what I want without having
to be a genius at the operating system and
wasting hours troubleshooting things that don't work
as expected.

In an "ideal world", I never have to goof around
with API calls, unless I was shooting
for something really weird.

Your take?
-T
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.