home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / dos / setfiledate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  2.3 KB  |  94 lines

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