PDA

View Full Version : DOS command


Sidewinder
01-04-2003, 06:23 PM
Hello, I'm at work and do not have my official AmigaDOS reference handy, but I need to find a command or trick to return the current directory. Any ideas?

Thanks.

Warface
01-04-2003, 06:30 PM
You mean "cd"? Or I misunderstood something...

Sidewinder
01-04-2003, 06:30 PM
Ok, here's the deal, I figured out that CD returnes the current dir, but does anyone know how to use that in an install script? I've tried this:

(set @source (run ("cd")))

But it doesn't work. Any other ideas?

lempkee
01-04-2003, 07:28 PM
hm mm its "/" T retrace to a dir , ie if your in sys:C/ then u type / to get back to Sys:

was it this u meant??

if not, if your talking of setting a primary dir then its "VOLUME request(ie sys:c/)" then on new line CD + path!

hope its what u meant.

Kronos
01-04-2003, 07:40 PM
Don't know if this is what you want, but I just tried this:
cd sys:
cd > ram:x
cd ram:
cd ? < x

and I was back on sys: :-D

Thomas
01-05-2003, 03:48 AM
What about

(run ("cd >env:current"))
(set #source (getenv "current"))

Did you examine the variable @execute-dir ? Documentation says it can be used to change the current directory but perhaps it already contains something if you read it.

You must not use names beginning with @ for your own variables. These are reserved for internal names. Why don't you read the documentation ?

Why do you want to know the name of the source directory ? Your current directory is the source directory, so you can just use "" as source.

Bye,
Thomas

elendil
01-05-2003, 03:59 AM
@kronos:

Cool. I have to try that. My cd experience is limited to 'cd <target>' :)

Sincerely,

-Kenneth Straarup