This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Imprivate's profile picture

Change Directory inside Program?

Started by Imprivate, 18 January 2014 - 03:11 PM
Imprivate #1
Posted 18 January 2014 - 04:11 PM
Hello all,

Simple question: Is there a way of changing directories INSIDE a program? I know 'fs.makeDir' makes a directory, is there a way to change to one?. I want my computer to automatically go to 'disk' on startup
wieselkatze #2
Posted 18 January 2014 - 04:13 PM
Why would you need something like that? I mean, if you want to run a program there just say
shell.run("disk/yourprogram") or sth. like that
Edited on 18 January 2014 - 03:14 PM
Imprivate #3
Posted 18 January 2014 - 04:45 PM
Yes, but I keep most of my programs on a Floppy Disk. Just wondering if there was something easier than entering 'cd disk' every time. Just being lazy ^^
wieselkatze #4
Posted 18 January 2014 - 04:56 PM
Ah you mean in your startup file to automatically change to a disk?
You could just write there
shell.setDir("disk")
Edited on 18 January 2014 - 04:15 PM
MKlegoman357 #5
Posted 18 January 2014 - 05:14 PM
Ah you mean in your startup file to automatically change to a disk?
You could just write there
fs.setDir("disk")

There is no fs.setDir(), but there is shell.setDir().
Edited on 18 January 2014 - 04:14 PM
wieselkatze #6
Posted 18 January 2014 - 05:16 PM
There is no fs.setDir(), but there is shell.setDir().

Sure, my bad, I was in another program messing a bit around :P/>
Edited on 18 January 2014 - 04:17 PM