Hi, there is a function in xharbour returning the short file name in
8.3 format of a long file name?
Hi, there is a function in xharbour returning the short file name in 8.3 format of a long file name?
EXAMPLE:
LF_ToShort("long_file_name.txt") -> "LONGFI~1.TXT"
thanks.
On 24-06-2021 07:12 pm, Marco wrote:
Hi, there is a function in xharbour returning the short file name in 8.3 format of a long file name?
EXAMPLE:
LF_ToShort("long_file_name.txt") -> "LONGFI~1.TXT"
thanks.
Hi,
Please try with the following:
#pragma begindump
#include <windows.h>
#include "hbapi.h"
HB_FUNC( GETSHORTPATHNAME )
{
char buffer[ MAX_PATH + 1 ] = {0};
GetShortPathName( hb_parcx(1), buffer, MAX_PATH );
hb_retc( buffer );
}
HB_FUNC( GETSHORTFILENAME )
{
char pszReturn[ MAX_PATH ] ;
pszReturn[0]= '\0' ;
GetShortPathName( hb_parcx( 1 ), pszReturn, MAX_PATH - 1 ) ;
hb_retc( pszReturn ) ;
}
#pragma enddump
HTH,
Warm regards,
Jayadev
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (0 / 16) |
Uptime: | 155:29:26 |
Calls: | 5,528 |
Calls today: | 1 |
Files: | 11,672 |
Messages: | 5,098,948 |