home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
HPFSLS.ZOO
/
lsea.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-17
|
2KB
|
58 lines
/*
* Stampa gli attributi estesi.
* (C)1990 by redmax@alessia.dei.unipd.it (Massimo A. Santin)
* $Log: lsea.c $
* Revision 1.1 91/05/08 20:00:55 Unknown
* Initial revision
*
*/
#include "ls.h"
static char rcsid[] = "$Header: d:/usr/utils/ls/rcs/lsea.c 1.1 91/05/08 20:00:55 Unknown Exp $";
void ls_ea(char* name, int level)
{
#ifdef OS2_ONLY
SEL sel;
PDENA1 pdena1;
ULONG ulCount;
USHORT offset = 0;
int exist_attribute = 0;
char *full_path;
int j;
full_path = (char *) malloc(CCHMAXPATHCOMP);
getcwd(full_path, CCHMAXPATHCOMP);
strcat(full_path, "/");
strcat(full_path, name);
DosAllocSeg(0, &sel, SEG_NONSHARED);
pdena1 = MAKEP(sel, 0);
ulCount = 0xFFFFFFFF;
exist_attribute = ! DosEnumAttribute(
ENUMEA_REFTYPE_PATH, /* path supplied */
full_path, /* filename */
1L, /* starts enum. with first attr. */
pdena1, /* buffer address */
65536L, /* buffer size */
&ulCount, /* number of attributes to retrieve */
ENUMEA_LEVEL_NO_VALUE, /* type of request */
0L
);
if (exist_attribute) {
while (ulCount--) { /* while there are attribute names */
for (j = 0; j < level * 2; j++)
putchar(' ');
printf(" ea \"%s\" (%d bytes)\n", pdena1->szName, (int) ((USHORT) pdena1->cbValue));
offset += sizeof(DENA1) + pdena1->cbName;
pdena1 = MAKEP(sel, offset);
}
}
DosFreeSeg(sel);
free((void *) full_path);
#endif
} /* ls_ea */