http://www.ousob.com --- Legacy Redefined #include <stdio.h> #include <string.h> #include <nit.h> #include <extend50.h> CLIPPER b_owner() { char objectName[48]; int ccode, completionCode, sequenceNumber, isSame; char filePath[256], fileName[15], creationDate[2]; char lastAccessDate[2], lastUpdateDateAndTime[4]; char lastArchiveDateAndTime[4]; BYTE directoryHandle, searchAttributes; BYTE fileAttributes, extendedFileAttributes; WORD objectType; long fileOwnerID, fileSize; char buffer[256]; WORD objUserType; int ccodeUser; char objUserName[48]; long objUserID; BYTE loginTime[7]; char day[10], time[9], ttime[3], AmPm[3]; WORD year; int PM; char month[9]; WORD ConnectionNumber; if( !PCOUNT || !ISCHAR(1) ) { _retl(0); } ConnectionNumber = GetConnectionNumber(); if( ConnectionNumber == 0 ) { _retl(0); } ccode = GetConnectionInformation( ConnectionNumber, objUserName, &objUserType, &objUserID, loginTime ); if ( ccode != 0 ) { _retl(0); } directoryHandle = GetDirectoryHandle( 22 ); sequenceNumber = -1; sprintf(buffer,"%s%c%c%s%c","sys",':','\\',_parc(1),'\0'); searchAttributes = 0x00, completionCode = ScanFileInformation(directoryHandle, buffer, (BYTE)searchAttributes, &sequenceNumber, fileName, &fileAttributes, &extendedFileAttributes, &fileSize, creationDate, lastAccessDate, lastUpdateDateAndTime, lastArchiveDateAndTime, &fileOwnerID); if ( completionCode != 0 ) { _retl(0); } GetBinderyObjectName(fileOwnerID, objectName, &objectType); /* printf("\ncurrent user id = *%s*\n", objUserName); printf("\nfile owner id = *%s*\n", objectName); */ if( (isSame = strcmp(objUserName,objectName)) == 0 ) { _retl(1); } else { _retl(0); } }