1File::HomeDir::Darwin::UCsaerrboCno(n3t)ributed Perl DocFuimleen:t:aHtoimoenDir::Darwin::Carbon(3)
2
3
4
6 File::HomeDir::Darwin - Find your home and other directories on Darwin
7 (OS X)
8
10 This module provides Darwin-specific implementations for determining
11 common user directories. In normal usage this module will always be
12 used via File::HomeDir.
13
14 Note -- since this module requires Mac::Carbon and Mac::Carbon does not
15 work with 64-bit perls, on such systems, File::HomeDir will try
16 File::HomeDir::Darwin::Cocoa and then fall back to the (pure Perl)
17 File::HomeDir::Darwin.
18
20 use File::HomeDir;
21
22 # Find directories for the current user
23 $home = File::HomeDir->my_home; # /Users/mylogin
24 $desktop = File::HomeDir->my_desktop; # /Users/mylogin/Desktop
25 $docs = File::HomeDir->my_documents; # /Users/mylogin/Documents
26 $music = File::HomeDir->my_music; # /Users/mylogin/Music
27 $pics = File::HomeDir->my_pictures; # /Users/mylogin/Pictures
28 $videos = File::HomeDir->my_videos; # /Users/mylogin/Movies
29 $data = File::HomeDir->my_data; # /Users/mylogin/Library/Application Support
30
32 · Test with Mac OS (versions 7, 8, 9)
33
34 · Some better way for users_* ?
35
36
37
38perl v5.32.0 2020-07-28 File::HomeDir::Darwin::Carbon(3)