Welcome, Guest. Please login or register.

Author Topic: drawer named from date  (Read 4783 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Orphan264Topic starter

drawer named from date
« on: January 28, 2020, 02:11:15 PM »
Looking for assistance with a script - I want to create a drawer named from the date. I am using OS 3.1.4.1

For example - today is January 28, 2020. I want the script to create a drawer named for the ANSI date such as
2020-01-28

Where do I begin? I appreciate the help.

 

Offline TribbleSmasher

Re: drawer named from date
« Reply #1 on: January 28, 2020, 06:28:53 PM »
Either you make a little script that takes an argument or something like this.

Code: [Select]
c:makedir `c:date`Dunno if this works everytime.
 

Offline Orphan264Topic starter

Re: drawer named from date
« Reply #2 on: January 29, 2020, 01:15:39 PM »
Thanks, I will try that and see what I have.
 

Offline kolla

Re: drawer named from date
« Reply #3 on: January 29, 2020, 03:14:58 PM »
Yeah, dream on :)

You wish to format the output of C:Date, but VERY SADLY, C:Date does not support that, so you have to jump through hoops around the problem.

Code: [Select]
Echo to T:timestamp
Makedir `List DATES T:timestamp LFORMAT %D`
Delete T:timestamp QUIET

This creates a temporary file, which you then can list with LDORMAT %D to get the date from, but you need "DATES" parameter or it will always say "Today", and then make a directory with this name - also SADLY it will be 29-Jan-20 and not 29-01-2020, and there is little you can do about that, and also this output depends on locale, so in case of the month of May, a system with English locale will for example say "29-May-20", while with Norwegian locales will say "29-Mai-20" and Swedish "29-Maj-20" etc.

If you think that this is all crazy and should be corrected, you can join my whining choir...
« Last Edit: January 29, 2020, 03:19:32 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline nbache

Re: drawer named from date
« Reply #4 on: January 29, 2020, 03:17:14 PM »
With OS4, you can do

Code: [Select]
makedir `date lformat %Y-%m-%d`
Not sure if your version of C:Date has the LFORMAT argument.

Edit: Seems not, according to Kolla's post above. Sorry.

Best regards,

Niels
« Last Edit: January 29, 2020, 03:17:57 PM by nbache »
 

Offline TribbleSmasher

Re: drawer named from date
« Reply #5 on: January 29, 2020, 06:09:08 PM »
Shouldn't be that hard to find another date alike tool that just outputs the date without locale messing it up.

http://aminet.net/package/util/cli/fdate
« Last Edit: January 29, 2020, 06:47:14 PM by TribbleSmasher »
 

Offline TribbleSmasher

Re: drawer named from date
« Reply #6 on: February 01, 2020, 03:36:59 AM »
Or, use this one.
It is a quick&dirty example.

For sorting purposes you might want to use option 'a', which fits best.

Unfortunately, AMIGA forum does not allow LHA attachments.
« Last Edit: February 01, 2020, 10:43:50 AM by TribbleSmasher »
 
The following users thanked this post: Orphan264

Offline kolla

Re: drawer named from date
« Reply #7 on: February 01, 2020, 11:22:23 AM »
Huh, why resort to third party software - even though AmigaDOS date is tedious in all kinds of ways, ARexx DATE works fine, for example
Code: [Select]
Makedir `rx “SAY DATE(S)”` may be good enough, it makes a 20200201 directory today.
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline TribbleSmasher

Re: drawer named from date
« Reply #8 on: February 01, 2020, 11:24:36 AM »
A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)
 

Offline kolla

Re: drawer named from date
« Reply #9 on: February 01, 2020, 12:41:11 PM »
A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)

The problem is that over time, your path fills up with a range of third party tools that you no longer have any idea where they came from or what they really do :)  ARexx you can count on being there, and it's in general a better choice for scripting.

Btw - if anyone feel like reporting an OS bug... well, ARexx bug - DATE(CENTURY) is supposed to return the number of days in this century, but it really looks more like the number of days since 01-01-1900, and not since 01-01-2000. So it's really a "Y2K" bug.
« Last Edit: February 01, 2020, 12:41:44 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline TribbleSmasher

Re: drawer named from date
« Reply #10 on: February 01, 2020, 05:33:09 PM »
I used to add several 'c' directories onto my system drive which are late-assigned to C: during startup.
This way i have a rather small C: (or sys:C/) but all my (de)crunchers are in sys:c3/, my own tools are in sys:c_plus/ and so on but they are still reachable from the path.

A thirdparty tool is as good as a dependency on AREXX, but i like any different solution of course. :)

The problem is that over time, your path fills up with a range of third party tools that you no longer have any idea where they came from or what they really do :) 
 

Offline nbache

Re: drawer named from date
« Reply #11 on: February 01, 2020, 07:22:48 PM »
I used to add several 'c' directories onto my system drive which are late-assigned to C: during startup.
This way i have a rather small C: (or sys:C/) but all my (de)crunchers are in sys:c3/, my own tools are in sys:c_plus/ and so on but they are still reachable from the path.
I once did that too. One downside of that is that when you install updates to the system components, or vice versa to the third party tools, you may be surprised by where they end up. In practice, I would end up installing everything by hand, even when it had installation scripts.

Best regards,

Niels
 

Offline TribbleSmasher

Re: drawer named from date
« Reply #12 on: February 01, 2020, 08:30:20 PM »
In practice, I would end up installing everything by hand, even when it had installation scripts.
Niels
Sure, but isn't that the fun of being able to do just that on Amiga? ;D
 

Offline nbache

Re: drawer named from date
« Reply #13 on: February 01, 2020, 10:20:29 PM »
In practice, I would end up installing everything by hand, even when it had installation scripts.
Sure, but isn't that the fun of being able to do just that on Amiga? ;D
Not in cases where you are trying to test the software, including its installation script.

Best regards,

Niels
 

Offline Orphan264Topic starter

Re: drawer named from date
« Reply #14 on: February 03, 2020, 03:19:19 PM »
Or, use this one.
It is a quick&dirty example.

For sorting purposes you might want to use option 'a', which fits best.

I want to thank you for going through the trouble of providing the example script! I really appreciate it!