Devaraj Das wrote:
Thanks all for the feedback. I have incorporated most of them. Attached is
the revised C API.
Thanks for revising this so quickly!
/**
* dfsStat
* used for getting information about a file/directory
*/
typedef struct {
tObjectKind mKind; /** file or directory */
char *mName; /* the name of the file */
tTime mCreationTime;
long mSize; /*the size of the file in bytes */
bool replicated; /*whether this file is replicated */
} dfsFileInfo;
Should 'bool replicated' instead be a replication count?
/** return information about a path as a (dynamically allocated) array
* of dfsFileInfo.
* numEntries is set to the number of elements in the array.
* If the path happens to be a file, the array will have just one element.
* If the path happens to be a directory, the dfsFileInfo elements in the
* array will contain information about the files/sub-dirs within the path.
* NULL is returned if the path does not exist or some other error is
* encountered. freeDfsFileInfo should be called passing the array and
* numEntries when it is no longer needed.
*/
dfsFileInfo *dfsGetPathInfo(dfsFS fs, char *path, int *numEntries);
As mentioned in my previous message, perhaps this should be split into
two functions:
dfsFileInfo *dfsGetPathInfo(dfsFS fs, char *path);
dfsFileInfo *dfsListDirectory(dfsFS fs, char *path, int *numEntries);
Doug