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: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 76:37:42 |
Calls: | 6,716 |
Files: | 12,247 |
Messages: | 5,357,576 |