4 * Copyright (C) 1993-1999 by Jochen Wiedmann and Marcin Orlowski
5 * Copyright (C) 2002-2010 by the FlexCat Open Source Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <proto/dos.h>
27 # define ZERO (BPTR)NULL
32 /* Returns the time of change.
33 Used for compatibility. */
34 int32
getft(char *filename
)
37 #if defined(__amigaos4__)
38 struct ExamineData
*ed
;
41 struct FileInfoBlock
*p_fib
;
42 #endif // __amigaos4__
44 #if defined(__amigaos4__)
45 if((ed
= ExamineObjectTags(EX_StringNameInput
, filename
, TAG_DONE
)) != NULL
)
47 timestamp
= ed
->Date
.ds_Days
* 86400; /* days */
48 timestamp
+= ed
->Date
.ds_Minute
* 60; /* minutes */
49 timestamp
+= ed
->Date
.ds_Tick
/ TICKS_PER_SECOND
; /* seconds */
51 FreeDosObject(DOS_EXAMINEDATA
, ed
);
54 if((p_fib
= AllocDosObject(DOS_FIB
, NULL
)) != NULL
)
56 if((p_flock
= Lock(filename
, ACCESS_READ
)) != ZERO
)
58 Examine(p_flock
, p_fib
);
60 timestamp
= p_fib
->fib_Date
.ds_Days
* 86400; /* days */
61 timestamp
+= p_fib
->fib_Date
.ds_Minute
* 60; /* minutes */
62 timestamp
+= p_fib
->fib_Date
.ds_Tick
/ TICKS_PER_SECOND
; /* seconds */
67 FreeDosObject(DOS_FIB
, p_fib
);
69 #endif // __amigaos4__