home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / dos / setfiledate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  2.1 KB  |  86 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: setfiledate.c,v 1.3 1996/10/24 15:50:37 aros Exp $
  4.     $Log: setfiledate.c,v $
  5.     Revision 1.3  1996/10/24 15:50:37  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.2  1996/09/21 14:14:23  digulla
  9.     Hand DOSBase to DoName()
  10.  
  11.     Revision 1.1  1996/09/11 12:54:47  digulla
  12.     A couple of new DOS functions from M. Fleischer
  13.  
  14.     Desc:
  15.     Lang: english
  16. */
  17. #include <clib/exec_protos.h>
  18. #include <dos/dosextens.h>
  19. #include <dos/filesystem.h>
  20. #include <clib/dos_protos.h>
  21. #include "dos_intern.h"
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <clib/dos_protos.h>
  27.  
  28.     AROS_LH2(BOOL, SetFileDate,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(STRPTR,             name, D1),
  32.     AROS_LHA(struct DateStamp *, date, D2),
  33.  
  34. /*  LOCATION */
  35.     struct DosLibrary *, DOSBase, 66, Dos)
  36.  
  37. /*  FUNCTION
  38.     Change the modification time of a file or directory.
  39.  
  40.     INPUTS
  41.     name - name of the file
  42.     date - new file time
  43.  
  44.     RESULT
  45.     !=0 if all went well, 0 else. IoErr() gives additional
  46.     information in that case.
  47.  
  48.     NOTES
  49.  
  50.     EXAMPLE
  51.  
  52.     BUGS
  53.  
  54.     SEE ALSO
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.     29-10-95    digulla automatically created from
  60.                 dos_lib.fd and clib/dos_protos.h
  61.  
  62. *****************************************************************************/
  63. {
  64.     AROS_LIBFUNC_INIT
  65.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  66.  
  67.     /* Get pointer to process structure */
  68.     struct Process *me=(struct Process *)FindTask(NULL);
  69.  
  70.     /* Get pointer to I/O request. Use stackspace for now. */
  71.     struct IOFileSys io,*iofs=&io;
  72.  
  73.     /* Prepare I/O request. */
  74.     iofs->IOFS.io_Message.mn_Node.ln_Type=NT_REPLYMSG;
  75.     iofs->IOFS.io_Message.mn_ReplyPort     =&me->pr_MsgPort;
  76.     iofs->IOFS.io_Message.mn_Length     =sizeof(struct IOFileSys);
  77.     iofs->IOFS.io_Flags=0;
  78.     iofs->IOFS.io_Command=FSA_SET_DATE;
  79.     /* io_Args[0] is the name which is set by DoName(). */
  80.     iofs->io_Args[1]=date->ds_Days;
  81.     iofs->io_Args[2]=date->ds_Minute;
  82.     iofs->io_Args[3]=date->ds_Tick;
  83.     return !DoName(iofs,name,DOSBase);
  84.     AROS_LIBFUNC_EXIT
  85. } /* SetFileDate */
  86.