Welcome, Guest. Please login or register.

Author Topic: Make Lock() look for path..?  (Read 2032 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: RunCommand path problem... also path parsing..
« Reply #14 from previous page: July 28, 2005, 06:40:18 PM »
"if you have an assign hugo: which consists of work:a, work:b and work:c, if you enter "path hugo: add" only work:a is added to the path."

That's precisely what happened to me. I guess it's something that could be added in the OS then...


"and a lock can only point to a directory, "

or a file. When looking inside a given assign my code worked with assigns to a single file. I think it might be because I take off the device's name from the the rest of the given file path before calling GetDeviceProc(), and then try to lock that path in each directory (lock) GetDeviceProc successively gives, to check if the file is there. If there's just a device name the path given to GetDevProc will be NULL (since ":" ends the string to a device only name, followed by NULL). And null corresponds to the root directory, or in the case of a multiassign the directory (ies) corresponding to the assign.  

Was just an attempt to understand it, but forget it, the thing works... :-)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Thomas

Re: RunCommand path problem... also path parsing..
« Reply #15 on: July 29, 2005, 10:46:16 AM »

Quote

When looking inside a given assign my code worked with assigns to a single file.


This cannot happen. Yes, locks could point to files. But the assign and path lists only contain directories. You cannot add a file to the path neither can you create an assign to a file.

You can safely assume that the locks in the path nodes point only to directories as well as the locks returned by GetDeviceProc only point to directories.

I don't see why you try to make it so complicated. The "which" procedure I gave you works exactly like the Which shell command.

Bye,
Thomas

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: RunCommand path problem... also path parsing..
« Reply #16 on: August 02, 2005, 06:31:08 PM »
"...neither can you create an assign to a file"

I have one to CygnusEd and it works.  :-?  I use it to launch CED saved files cause I have CED a directory not in the path or C:.
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Thomas

Re: RunCommand path problem... also path parsing..
« Reply #17 on: August 02, 2005, 09:22:03 PM »

I am amazed, didn't know that. However it is of no use. In case of CED you always have to enter CED: instead of ED and CED always opens a new window rather than opening multiple files in one window.

And regarding our topic, it makes no difference either. If you give CED: as command name, you get the lock immediately without searching and you cannot add CED: to the path - "object not of required type". The path can only hold directories,

Doing something like "assign c: ced: add" does not have any sense either. You just get the "object is not of required type" message for every typo, and even CED itself is not found.

Bye,
Thomas

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
Re: RunCommand path problem... also path parsing..
« Reply #18 on: August 03, 2005, 04:56:14 PM »
Maybe it doens't matter, but I found that Which finds multiple assigns in the Path :lol: Maybe it just gets the names of the locks in the path and then tries to find them in multiassign lists.
I had never bothered with Which and didn't even knew very well what it does. It would have spared me a night and a half of coding... :-x  :-)
\\"We made Amiga, they {bleep}ed it up\\"