English Amiga Board


Go Back   English Amiga Board > Support > support.AmigaOS

 
 
Thread Tools
Old 09 December 2022, 01:22   #1
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
Eek You can ASSIGN to an executable?!

I can't believe in the years I have used the Amiga I never stumbled upon this, and I am not sure if it's a bug or a feature, but it turns out you can issue an ASSIGN command pointing to an executable, and when you do call that "volume" name, it launches the application.

This definitely sounds like a bug, but is it? Can anyone explain more? I just tried this on 3.1, not sure if any other versions do it.
Amiga1992 is offline  
Old 09 December 2022, 01:38   #2
lesta_smsc
Registered User
 
lesta_smsc's Avatar
 
Join Date: Feb 2012
Location: United Kingdom
Posts: 3,184
I think the ASSIGN actually worked as a shortcut. Whatever you pointed it to was 'registered' as the path that would be accessed - so you could even load a image file if you wanted to!
lesta_smsc is offline  
Old 09 December 2022, 02:38   #3
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,237
never heard of this before, interesting.
DisasterIncarna is offline  
Old 09 December 2022, 08:42   #4
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,302
Quote:
Originally Posted by Akira View Post
I can't believe in the years I have used the Amiga I never stumbled upon this, and I am not sure if it's a bug or a feature, but it turns out you can issue an ASSIGN command pointing to an executable, and when you do call that "volume" name, it launches the application.

This definitely sounds like a bug, but is it? Can anyone explain more? I just tried this on 3.1, not sure if any other versions do it.

You can assign to anything you can "lock", including an arbitrary file (not only executables). I would not call this a bug, it is just a side effect of how assigns and locks work, and how they are resolved by the file system. So that is actually not an issue.



If the assign goes to a file (not a directory), opening that assign will open the file. This is because it resolves to a "lock" on the object (the file) and an empty path ("") which needs to be resolved by the file system to the object itself representing the file, the same way an empty string resolves to the current directory.


It should be even possible to "CD" into this assign, and then execute a binary through the empty string ("") through the very same mechanism.



All in all, it is just a side effect how Tripos resolves objects.
Thomas Richter is offline  
Old 09 December 2022, 09:24   #5
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,262
Quote:
Originally Posted by lesta_smsc View Post
so you could even load a image file if you wanted to!

Yes indeed, with Assign you can also dismount a Volume or Floppy Device, CD etc...
AMIGASYSTEM is offline  
Old 11 December 2022, 18:19   #6
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
This is all so weird discovering it after 30+ years. Yeah so assign is basically a symlink.
Couldn';t anything wrong happen when a program tries to access an assign as a folder but encounters a file instead?
And how would you use a disk image this way?
Amiga1992 is offline  
Old 11 December 2022, 21:42   #7
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
Quote:
Originally Posted by Thomas Richter View Post
You can assign to anything you can "lock", including an arbitrary file (not only executables). I would not call this a bug, it is just a side effect of how assigns and locks work, and how they are resolved by the file system.
Seems like they forgot to check if you specified a file or a folder. Assigning to a file makes no sense, so definitely a bug even if it can work for some things.
Quote:
Originally Posted by Akira View Post
Yeah so assign is basically a symlink.
Not exactly. Try to use 'type' on a text file you assigned to using the assign. It doesn't work.
Quote:
Originally Posted by Akira View Post
And how would you use a disk image this way?
Can't work because the OS doesn't know anything about the file system used in the disk image.
Thorham is offline  
Old 11 December 2022, 22:12   #8
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 362
Lol, nice catch. And since "Assign DIRS" lists those files assigned then there is a bug somewhere.
no9 is offline  
Old 12 December 2022, 08:28   #9
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,302
Quote:
Originally Posted by Thorham View Post
Seems like they forgot to check if you specified a file or a folder. Assigning to a file makes no sense, so definitely a bug even if it can work for some things.
Actually, I don't agree. This *must* work, due to the way how the file system has to operate, so I would not consider this a bug. At least, for a properly implement file system, this does not establish a problem.

Remember, the following sequence is an equivalent to OpenFromLock(lock):
Code:
 lock=Lock("myfiletooopen",SHARED_LOCK); CurrentDir(lock); /* yes, even if lock does point to a file! */ file = Open("",MODE_READ);
This looks strange, but is all according to the specs and valid code. The only thing an "assign" does is to provide a name to a lock, so it's not any different. The way how the dos.library handles an assign is that it resolves its symbolic name to a lock, and then passes the lock-name pair to the file system. The file system uses everything behind the device separator as file name, which is then just empty. Really, I know this looks bizarre, but it's just the beauty of Tripos that makes this work, and it should work.
Thomas Richter is offline  
Old 12 December 2022, 10:27   #10
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,636
Quote:
Originally Posted by Thomas Richter View Post
Actually, I don't agree. This *must* work, due to the way how the file system has to operate, so I would not consider this a bug. At least, for a properly implement file system, this does not establish a problem.

Remember, the following sequence is an equivalent to OpenFromLock(lock):
Code:
 lock=Lock("myfiletooopen",SHARED_LOCK); CurrentDir(lock); /* yes, even if lock does point to a file! */ file = Open("",MODE_READ);
This looks strange, but is all according to the specs and valid code. The only thing an "assign" does is to provide a name to a lock, so it's not any different. The way how the dos.library handles an assign is that it resolves its symbolic name to a lock, and then passes the lock-name pair to the file system. The file system uses everything behind the device separator as file name, which is then just empty. Really, I know this looks bizarre, but it's just the beauty of Tripos that makes this work, and it should work.
Setting the current directory to point to a file - that's new
hooverphonique is offline  
Old 13 December 2022, 22:38   #11
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,646
I still fail to see how this is not a bug since any other use but a directory seems to be problematic.
Amiga1992 is offline  
Old 19 December 2022, 09:09   #12
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
Quote:
Originally Posted by Thomas Richter View Post
Really, I know this looks bizarre, but it's just the beauty of Tripos that makes this work, and it should work.
At the OS level, perhaps, but I see no reason why it should work in the console. You can't assign to a file and cd to it, for example. You can't type text files. Seems better to disable it in the console assign command (not talking about the OS level).
Thorham is offline  
Old 19 December 2022, 11:00   #13
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,262
Quote:
Originally Posted by no9 View Post
Lol, nice catch. And since "Assign DIRS" lists those files assigned then there is a bug somewhere.
There is no need to Write "Assign DIRS", to see all the assignments in the system you only need to write "ASSIGN"

Assign I would say is the most representative command of the Amiga system.

Years ago when I was burning PC-Windows Games and Applications to CD, if I made a mistake in label name, you could trash the CD, instead you would just have to have the Assign command on PC to use that CD normally.

Always another Amiga peculiarity, although many people do not know it, there is an Amiga Device that allows you to Edit, Rename, delete files from the CD "virtually", very convenient when in the CD you do not want to show folders with viruses, corrupted files etc..

Last edited by AMIGASYSTEM; 19 December 2022 at 11:05.
AMIGASYSTEM is offline  
Old 19 December 2022, 11:08   #14
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
Quote:
Originally Posted by AMIGASYSTEM View Post
Years ago when I was burning PC-Windows Games and Applications to CD, if I made a mistake in label name, you could trash the CD, instead you would just have to have the Assign command on PC to use that CD normally.
CD-RW
Thorham is offline  
Old 19 December 2022, 11:45   #15
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,262
Quote:
Originally Posted by Thorham View Post
CD-RW

No !!! I'm talking about a "Real" CD-RW Burner, but a software "AMiGA" that allows you to change the data of a CD "Virtually" !!!!

All changed or deleted data is added on a folder called "Data", if you delete the folder "DATA" the CD will be visible as it was in original !!!!

Of course the CD with a normal Device will be seen in its entirety, only the mentioned Device can see and use the changes !!!

If I was not clear, I will make a comprehensive video !!!
AMIGASYSTEM is offline  
Old 19 December 2022, 11:56   #16
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
Quote:
Originally Posted by AMIGASYSTEM View Post
If I was not clear, I will make a comprehensive video !!!
I meant burning the CD and then tossing the CD because it went wrong, not the device.
Thorham is offline  
Old 19 December 2022, 12:28   #17
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 362
Quote:
Originally Posted by AMIGASYSTEM View Post
There is no need to Write "Assign DIRS", to see all the assignments in the system you only need to write "ASSIGN"

That's not the point. When you deliberately specify the parameter that supposedly lists directories it should print only them. Otherwise it is misleading and wrong.

If you don't specify any parameters the assign command can print whatever it wants, even a random poems. That's why it is a bug.
no9 is offline  
Old 19 December 2022, 12:35   #18
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,395
That's interesting. Something (somewhat unrelated but equally odd ) that I used to do that worked for a lot of applications was to make their directory icon a project and then make the default tool for opening it the actual application inside. Probably not wise, but was inspired by the way application drawers in RiscOS worked.
Karlos is offline  
Old 21 December 2022, 23:04   #19
paul1981
Registered User
 
paul1981's Avatar
 
Join Date: Oct 2013
Location: England
Posts: 424
@Akira

Sounds like one of those Mandela thingamabobs. Never heard of it in my life! Then again, I was just as surprised a couple of years ago when I discovered ASL had a delete function in the menu, and that the 'Update All' function in the Workbench menu actually worked as I swear it never used to. I'm talking 3.0 here in both cases. Been using it for 30 years almost.

@Karlos

I wonder if that is a feature and that's where RiscOS nicked it from in the first place? (Tripos).
paul1981 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to assign some buffer for a string? peceha Coders. Blitz Basic 3 21 August 2018 11:19
How to re-assign a keyboard key? Zerg support.WinUAE 7 11 October 2013 19:24
f1gp: hd installation and assign.. jolly11 support.Games 1 21 November 2009 11:57
Assign command fc.studio support.Apps 2 28 December 2005 18:36
Multi-Assign Shoonay support.Apps 17 12 April 2005 15:16

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:54.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18164 seconds with 12 queries