CompuServe Messages

#ParentDIR from CLI

    01-Jan-87 12:17:52
Sb: #ParentDIR from CLI
Fm: Kelly Jordan 76475,1146
To: Mike Berro 73267,3361
Mike, have you looked at the program called LD or LD4? This is a program for for getting a directory. This program works without being given a directory to start with. In this case, for the Lock() command, it uses a name that is a null string. Here is a fragment of that program. Hope this is what you are looking for. main(argc,argv) int argc; char *argv[]; { char *dirname; /* Selected AmigaDOS directory */ struct FileLock *dir; /* Locked AmigaDOS directory */ struct FileInfoBlock *fb; /* File Info from locked directory */ BOOL fail; /* Directory Access Failure */ UBYTE count; /* Line length count */ if (argc == 1) dirname = ""; else if (argc == 2) dirname = argv[1]; else { printf("Usage: Ld [dirname]\n"); Exit(); } fb = (struct FileInfoBlock *) AllocMem(sizeof(struct FileInfoBlock),0); dir = Lock(dirname,ACCESS_READ); fail = (dir == NULL) | !Examine(dir,fb); if (fail) { printf("Invalid directory '%s' requested\n",dirname); FreeMem(fb,sizeof(struct FileInfoBlock)); Exit(); } Happy new year, Kelly