home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 2 / amigaformatcd02.iso / comms / netsoftware / nethandler.lha / NetHandler / server / dir.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-16  |  2.0 KB  |  75 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2. /* |_o_o|\\ Copyright (c) 1987, 1988 The Software Distillery.  All Rights  */
  3. /* |. o.| || Reserved.  This program may not be distributed without the    */
  4. /* | .  | || permission of the authors:                            BBS:    */
  5. /* | o  | ||   John Toebes     Doug Walker    Dave Baker                   */
  6. /* |  . |//                                                                */
  7. /* ======                                                                  */
  8. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9. /* Directory Manipulation */
  10. /*  RmtCreateDir RmtExamine RmtExNext RmtParent */
  11. #include "server.h"
  12.  
  13. void RmtCreateDir(global,pkt)
  14. GLOBAL global;
  15. struct DosPacket *pkt;
  16. /* Arg1 - Lock */
  17. /* Arg2 - name */
  18. /* Arg3 (optional) Attributes */
  19. {
  20.    BUG(("RmtCreateDir\n"));
  21.    BUGBSTR("Creating directory '%s'\n", global->RP.Data);
  22.  
  23.    pkt->dp_Arg1 = global->RP.Arg1;
  24.    MBSTR(global->RP.Data, global->fib);
  25.    pkt->dp_Arg2 = (LONG)MKBADDR(global->fib);
  26.    pkt->dp_Arg3 = global->RP.Arg3;
  27.  
  28.    Dispatch(global);
  29.  
  30.    global->RP.DLen = 0;
  31. }
  32.  
  33. void RmtExamine(global, pkt)
  34. GLOBAL global;
  35. struct DosPacket *pkt;
  36. /* Arg1: Lock of object to examine */
  37. /* Arg2: FileInfoBlock to fill in */
  38. {
  39. #if DEBUG
  40.    struct FileInfoBlock *fib;
  41. #endif
  42.    BUG(("RmtExamine/RmtExNext - lock %lx\n", global->RP.Arg1));
  43.  
  44.    pkt->dp_Arg1 = global->RP.Arg1;
  45.    pkt->dp_Arg2 = (LONG)MKBADDR(global->fib);
  46.    MQ(global->RP.Data, global->fib, sizeof(struct FileInfoBlock));
  47.  
  48.    Dispatch(global);
  49.  
  50. #if DEBUG
  51.    fib = (struct FileInfoBlock *)global->fib;
  52.    BUG(("RmtEx: FIB name='%s' size=%ld numblocks=%ld\n", 
  53.       fib->fib_FileName+1, fib->fib_Size, fib->fib_NumBlocks));
  54. #endif
  55.  
  56.    MQ(global->fib, global->RP.Data, sizeof(struct FileInfoBlock));
  57.  
  58.    global->RP.DLen = sizeof(struct FileInfoBlock);
  59. }
  60.  
  61. void RmtParent(global,pkt)
  62. GLOBAL global;
  63. struct DosPacket *pkt;
  64. /* Arg1 - Lock */
  65. {
  66.    BUG(("RmtParent\n"));
  67.  
  68.    pkt->dp_Arg1 = global->RP.Arg1;
  69.  
  70.    Dispatch(global);
  71.  
  72.    global->RP.DLen = 0;
  73. }
  74.  
  75.