SetFileDate & DeleteFile gone?

Have a question about our Software Developer Kit? Ask them here.

SetFileDate & DeleteFile gone?

Postby JosDuchIt » Wed Jan 21, 2015 7:31 pm

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?
JosDuchIt
 
Posts: 286
Joined: Sun Jun 26, 2011 6:47 pm

Re: SetFileDate & DeleteFile gone?

Postby salass00 » Wed Jan 21, 2015 9:51 pm

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.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 470
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: SetFileDate & DeleteFile gone?

Postby kas1e » Wed Jan 21, 2015 10:19 pm

@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
kas1e
Beta Tester
Beta Tester
 
Posts: 453
Joined: Sat Jun 18, 2011 8:56 am

Re: SetFileDate & DeleteFile gone?

Postby JosDuchIt » Fri Jan 23, 2015 10:17 am

thanks both
JosDuchIt
 
Posts: 286
Joined: Sun Jun 26, 2011 6:47 pm

Re: SetFileDate & DeleteFile gone?

Postby Raziel » Sat Jan 24, 2015 2:16 am

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
If slaughterhouses had glass walls, everyone would be a vegetarian. ~ Sir Paul McCartney
-
Did everything just taste purple for a second? ~ Philip J. Fry
-
Ain't got no cash, ain't got no style, ladies vomit when I smile. ~ Dr. John Zoidberg
User avatar
Raziel
 
Posts: 748
Joined: Sat Jun 18, 2011 5:00 pm
Location: A haunted Castle somewhere in the Bavarian Mountains

Re: SetFileDate & DeleteFile gone?

Postby colinw » Sat Jan 24, 2015 2:37 am

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
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 156
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: SetFileDate & DeleteFile gone?

Postby Raziel » Sat Jan 24, 2015 11:30 am

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)
If slaughterhouses had glass walls, everyone would be a vegetarian. ~ Sir Paul McCartney
-
Did everything just taste purple for a second? ~ Philip J. Fry
-
Ain't got no cash, ain't got no style, ladies vomit when I smile. ~ Dr. John Zoidberg
User avatar
Raziel
 
Posts: 748
Joined: Sat Jun 18, 2011 5:00 pm
Location: A haunted Castle somewhere in the Bavarian Mountains

Re: SetFileDate & DeleteFile gone?

Postby colinw » Sat Jan 24, 2015 12:11 pm

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.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 156
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.


Return to SDK Support

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests