Page 1 of 1

SetFileDate & DeleteFile gone?

Posted: Wed Jan 21, 2015 6:31 pm
by JosDuchIt
noted the following passing from the SDK of 2010 to ten 29/9/2013 kit

In dosextens.h the disappearance of dol_Task define and the DLT_DIRECTORY define
Wheras i can live with it & change my source, i wonder why they couldn't be kept

I also note in dos.library the disappearance of DeleteFile() and SetFileDate()
These are more serious changes
Neither of these were previously said to be obsolete or deprecated and dos.doc does not point to alternatives to use.
What is happening?

Re: SetFileDate & DeleteFile gone?

Posted: Wed Jan 21, 2015 8:51 pm
by salass00
DeleteFile() and SetFileDate() have been renamed to Delete() and SetDate() as they do not work on just files.

To get legacy code to compile with the latest DOS includes the easiest method is to just add the following line to the code:

Code: Select all

#include <dos/obsolete.h>
In the latest SDK this file containing legacy definitions is no longer included implicitly by the other dos includes and therefore has to be included explicitly if needed.

Re: SetFileDate & DeleteFile gone?

Posted: Wed Jan 21, 2015 9:19 pm
by kas1e
@JosDuchIt
Maybe it will help somehow as well, In dopus5 we cover both old and new sdk of dos like this:

Code: Select all

#if defined(__amigaos4__) && defined(SetDate)	// in case we on new OS4's DOS-SDK, do some ifdef which allow builds src on all sdk versions.
		Delete(..);
		SetDate(..);
#else
		DeleteFile(..);
		SetFileDate(..);
#endif 

Re: SetFileDate & DeleteFile gone?

Posted: Fri Jan 23, 2015 9:17 am
by JosDuchIt
thanks both

Re: SetFileDate & DeleteFile gone?

Posted: Sat Jan 24, 2015 1:16 am
by Raziel
I came across the disappearance of dol_Task aswell.

May someone be so nice and explain what is was used for and why it has been ditched?

Thanks

Re: SetFileDate & DeleteFile gone?

Posted: Sat Jan 24, 2015 1:37 am
by colinw
Raziel wrote: I came across the disappearance of dol_Task aswell.
May someone be so nice and explain what is was used for and why it has been ditched?
Thanks
Seriously. ?

dol_Task wasn't a task pointer, it is a message port instead, SetFileDate() also sets the date on directories, DeleteFile() will delete
directories and links too, there are many more....

fh_Port wasn't a message port, (who would have guessed), it was a boolean value to indicate whether a stream was interactive or not,
fh_Type wasn't anything to do with a type (surprise !!), it was infact a message port pointer.

Have a good look through the obsolete.h file, it's worth it just for a good laugh.

Re: SetFileDate & DeleteFile gone?

Posted: Sat Jan 24, 2015 10:30 am
by Raziel
colinw wrote:
Raziel wrote: I came across the disappearance of dol_Task aswell.
May someone be so nice and explain what is was used for and why it has been ditched?
Thanks
Seriously. ?

dol_Task wasn't a task pointer, it is a message port instead, SetFileDate() also sets the date on directories, DeleteFile() will delete
directories and links too, there are many more....

fh_Port wasn't a message port, (who would have guessed), it was a boolean value to indicate whether a stream was interactive or not,
fh_Type wasn't anything to do with a type (surprise !!), it was infact a message port pointer.

Have a good look through the obsolete.h file, it's worth it just for a good laugh.
Thank you very much, Colin.

I can't code myself.
I stumbled over this when doing a port, just wanted to be sure that it's secure to be commented out (and not haunt me afterwards)

Re: SetFileDate & DeleteFile gone?

Posted: Sat Jan 24, 2015 11:11 am
by colinw
Raziel wrote: Thank you very much, Colin.
I can't code myself.
I stumbled over this when doing a port, just wanted to be sure that it's secure to be commented out (and not haunt me afterwards)
I'd say NO, you can't just comment out bits of code and expect it to stay working.
You have two choices, just add; #include <dos/obsolete.h> at the top, Or, change the offending line from; dol_Task to dol_Port.
Either will do, but I certainly wouldn't just remove the code without knowing what it does.