How to link to files in other folders

Joined
May 6, 2011
Messages
3
Reaction score
0
Points
1
I am running a statistical program that is running in the following sub dir:

Code:
MacintoshHD/Users/Myname/Dropbox/Stuff/Subfolder
And I want to reference a file located in another folder.

Code:
MacintoshHD/Users/Myname/Dropbox/OtherStuff/OtherSubfolder

When I program:
Code:
read "/Dropbox/OtherStuff/OtherSubfolder

I get file not found.

In Linux this would have worked (I think). In windows I would say
Code:
read "d:/Dropbox/ blah blah blah"

Do I need to put in the full path with the MacintoshHD part as well?

Many thanks

Rich
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Is "read" a program you've installed or are you trying to read/view the file? If so, you want to use "cat" or "more" or "less" to do that..

So your command would be something like:
Code:
cat ~/DropBox/OtherStuff/OtherSubFolder/OtherFile

You say you want to link folders, but are reading..could you explain a little more on what you are trying to do?

Regards
 
OP
G
Joined
May 6, 2011
Messages
3
Reaction score
0
Points
1
Actually I just wanted to put in the path in a program to another file.

After messing around the following seems to work:

Code:
/Users/myname/Dropbox/folder/subfolder/anothersub/file


I switched to OS X from ubuntu linux and in linux I would not have had to put in the "Users/myname" part in the path.

As I am on the only user on my Mac, this seems redundant.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Just as in Linux, you can prefix your path's with "~" to get your home directory. Even on Linux, your home directory as a user was still in /home/<username>/, that's no different here in OS X..

So if anything coming from Linux means that a lot more of the OS X's FreedBSD roots should make a lot more sense..:)

Regards
 
OP
G
Joined
May 6, 2011
Messages
3
Reaction score
0
Points
1
Just as in Linux, you can prefix your path's with "~" to get your home directory. Even on Linux, your home directory as a user was still in /home/<username>/, that's no different here in OS X..

So if anything coming from Linux means that a lot more of the OS X's FreedBSD roots should make a lot more sense..:)

Regards


Oh duuhh!! I'm an idiot - I completely forgot that! Thanks! That'll make it easier!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top