This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-01-29 12:26:37

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Mac and linux desktop path?

I'm making a Java application and I need to know the path to the desktop on mac and linux.
On windows it's C:\Users\UserName\Desktop
Thanks in advance as I'll delete this after I get an answer.  smile


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#2 2012-01-29 12:35:15

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Mac and linux desktop path?

on linux i think it is /home/UserName/Desktop


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2012-01-29 12:36:06

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mac and linux desktop path?

TRocket wrote:

on linux i think it is /home/UserName/Desktop

No drive beginning?


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#4 2012-01-29 12:37:42

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Mac and linux desktop path?

poopo wrote:

TRocket wrote:

on linux i think it is /home/UserName/Desktop

No drive beginning?

no


http://i.imgur.com/1QqnHxQ.png

Offline

 

#5 2012-01-29 12:48:49

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mac and linux desktop path?

TRocket wrote:

poopo wrote:

TRocket wrote:

on linux i think it is /home/UserName/Desktop

No drive beginning?

no

That's odd Thanks.  hmm  Thanks!


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#6 2012-01-29 13:21:17

legoscratch
Scratcher
Registered: 2010-06-18
Posts: 100+

Re: Mac and linux desktop path?

On mac it is
/Volumes/Macintosh HD/Users/shortname/Desktop/
or just
/Users/shortname/Desktop/

Make sure you use the short name though.


If you are having trouble with simple counting, use the following mnemonic device: 1 comes before 2 comes before 5,280 comes before 523,860,759 comes after the square root of -153 comes before π. This will make your previous counting problems seem like no big deal.

Offline

 

#7 2012-01-29 19:27:43

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Mac and linux desktop path?

poopo wrote:

TRocket wrote:

poopo wrote:


No drive beginning?

no

That's odd Thanks.  hmm  Thanks!

Linux and Mac don't have drive letters lol... Instead they have stuff like sda1 etc.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#8 2012-01-30 12:21:54

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mac and linux desktop path?

So short name is like the username?


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#9 2012-01-31 03:00:59

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Mac and linux desktop path?

poopo wrote:

So short name is like the username?

yes but it can't contain spaces


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#10 2012-01-31 10:36:30

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Mac and linux desktop path?

Yeah, Windows is the only one with drive names at the beginning. Darwin and Linux have them as mounted folders I believe.


Posts: 20000 - Show all posts

Offline

 

#11 2012-01-31 10:54:23

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Mac and linux desktop path?

nathanprocks wrote:

poopo wrote:

So short name is like the username?

yes but it can't contain spaces

and capitals
actually you better use ~/Desktop (yes, dsektop capitalized), as ~ is the path to the user's directory  smile

Offline

 

#12 2012-01-31 14:00:45

poopo
Scratcher
Registered: 2009-09-20
Posts: 1000+

Re: Mac and linux desktop path?

Could someone with a mac please run this code and report to me the output and your shortname

Code:

class test
{
    public static void main(String[] args)
    {
        System.out.println(System.getProperty("user.name"));
    }
}

It's java btw.

Last edited by poopo (2012-01-31 14:01:59)


http://i45.tinypic.com/28rnqki.jpg

Offline

 

#13 2012-01-31 19:22:55

tunasushi
Scratcher
Registered: 2009-10-07
Posts: 15

Re: Mac and linux desktop path?

Easiest way to do it is this:
~/Desktop/

On all the *ix's (including Mac), the ~ designates the home folder of the current user.

EDIT: the ~ is not a dash, it is the squiggly thing above tab (it looks similar in the small font)

Last edited by tunasushi (2012-01-31 19:26:24)

Offline

 

#14 2012-05-17 11:00:25

TheLinuxUser
New Scratcher
Registered: 2012-05-17
Posts: 1

Re: Mac and linux desktop path?

poopo wrote:

TRocket wrote:

on linux i think it is /home/UserName/Desktop

No drive beginning?

Partitions on linux don't need drive names, in fact on linux your dirve has to be the / drive.

Offline

 

#15 2012-05-17 13:17:02

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Mac and linux desktop path?

poopo wrote:

Could someone with a mac please run this code and report to me the output and your shortname

Code:

class test
{
    public static void main(String[] args)
    {
        System.out.println(System.getProperty("user.name"));
    }
}

It's java btw.

Works for me  smile  It echoed the correct shortname.

Also: cool, I just learnt to compile java code! Thanks.  tongue


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#16 2012-05-17 14:21:00

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Mac and linux desktop path?

yeah on mac you can just do ~/Desktop

regardless of where your user data is kept it will still work fine


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#17 2012-05-18 01:17:27

jji7skyline_test
New Scratcher
Registered: 2011-05-16
Posts: 55

Re: Mac and linux desktop path?

muppetds wrote:

yeah on mac you can just do ~/Desktop

regardless of where your user data is kept it will still work fine

That's right.

Offline

 

Board footer