SetFileDate & DeleteFile gone?

Have a question about our Software Developer Kit? Ask them here.
Post Reply
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

SetFileDate & DeleteFile gone?

Post 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?
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: SetFileDate & DeleteFile gone?

Post 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.
kas1e
Beta Tester
Beta Tester
Posts: 542
Joined: Sat Jun 18, 2011 7:56 am
Contact:

Re: SetFileDate & DeleteFile gone?

Post 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 
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: SetFileDate & DeleteFile gone?

Post by JosDuchIt »

thanks both
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: SetFileDate & DeleteFile gone?

Post 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
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: SetFileDate & DeleteFile gone?

Post 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.
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: SetFileDate & DeleteFile gone?

Post 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)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: SetFileDate & DeleteFile gone?

Post 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.
Post Reply