Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!alistair From: alistair@microsoft.UUCP (Alistair BANKS) Newsgroups: comp.os.os2 Subject: Re: Extended Attribute questions Message-ID: <54014@microsoft.UUCP> Date: 9 Apr 90 22:11:30 GMT References: Reply-To: alistair@microsoft.UUCP (Alistair BANKS) Distribution: comp Organization: Microsoft Corp., Redmond WA Lines: 52 | 1. Which standard commands and utilities know about and preserve extended | attributes? There was a new API added to 1.2 called DosCopy which will copy whole files and their attributes to a target. In fact, this API will copy whole subdirectories as well. USHORT DosCopy(pszSrc, pszDest, usOpt, ulReserved); PSZ pszSrc; /* pointer to name of source file */ PSZ pszDest; /* pointer to name of target file */ USHORT usOpt; /* options */ ULONG ulReserved; /* must be zero */ The "standard commands & utilties" in os/2 1.2 have been re-coded to preserve or recognise extended attributes including xcopy, copy etc. The PM File Manager allows you to browse certain Extended Attributes (EAs) such as the file type ".TYPE", .SUBJECT, .ICON etc in the File.Properties menu. | 2. The API seems to only allow you to pull out a list of specified | attributes; is there a way of retrieving the whole list, without | specifying the names in advance? If not, how would you duplicate a | file, preserving its attributes, without knowing in advance what | attributes it had? The EA retrieval APIs are specified by name (DosQPathInfo, DosFindFirst2), but you can get the names of EAs attached to a file using: USHORT DosEnumAttribute(usRefType, pvFile, ulEntry, pvBuf, cbBuf, pulCount, ulInfoLevel, ulReserved); The DosEnumAttribute function enumerates extended attributes for a specified file or subdirectory. Also: I would point out that EAs are available in _all_ OS/2 file systems, including HPFS _AND_ FAT and are fully supported by LanManager 2.0. This is very often misunderstood and/or mis-quoted. On a FAT file system a file's EAs are pointed to in its directory entry using some of the her-to reserved bits, and the data is owned and stored in a hidden system read-only file in the root called "EA DATA. SF" - it is meant to be very hard to delete since it is so important, but it is fully downward compatible with any version of DOS or chkdsk. Please dont remove or backup this file seperately. The OS/2 EA APIs give full supportable access to EAs on all file systems. "In other words, EAs are fully supported and accesible in OS/2 1.2" Alistair Banks OS/2 Group Microsoft