Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

file::homedir::windows(3) [centos man page]

File::HomeDir::Windows(3)				User Contributed Perl Documentation				 File::HomeDir::Windows(3)

NAME
File::HomeDir::Windows - Find your home and other directories on Windows SYNOPSIS
use File::HomeDir; # Find directories for the current user (eg. using Windows XP Professional) $home = File::HomeDir->my_home; # C:Documents and Settingsmylogin $desktop = File::HomeDir->my_desktop; # C:Documents and SettingsmyloginDesktop $docs = File::HomeDir->my_documents; # C:Documents and SettingsmyloginMy Documents $music = File::HomeDir->my_music; # C:Documents and SettingsmyloginMy DocumentsMy Music $pics = File::HomeDir->my_pictures; # C:Documents and SettingsmyloginMy DocumentsMy Pictures $videos = File::HomeDir->my_videos; # C:Documents and SettingsmyloginMy DocumentsMy Video $data = File::HomeDir->my_data; # C:Documents and SettingsmyloginLocal SettingsApplication Data DESCRIPTION
This module provides Windows-specific implementations for determining common user directories. In normal usage this module will always be used via File::HomeDir. Internally this module will use Win32::GetFolderPath to fetch the location of your directories. As a result of this, in certain unusual situations (usually found inside large organisations) the methods may return UNC paths such as "\cifs.localhome$". If your application runs on Windows and you want to have it work comprehensively everywhere, you may need to implement your own handling for these paths as they can cause strange behaviour. For example, stat calls to UNC paths may work but block for several seconds, but opendir() may not be able to read any files (creating the appearance of an existing but empty directory). To avoid complicating the problem any further, in the rare situation that a UNC path is returned by "GetFolderPath" the usual -d validation checks will not be done. SUPPORT
See the support section the main File::HomeDir module. AUTHORS
Adam Kennedy <adamk@cpan.org> Sean M. Burke <sburke@cpan.org> SEE ALSO
File::HomeDir, File::HomeDir::Win32 (legacy) COPYRIGHT
Copyright 2005 - 2011 Adam Kennedy. Some parts copyright 2000 Sean M. Burke. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.3 2012-10-19 File::HomeDir::Windows(3)

Check Out this Related Man Page

File::BaseDir(3pm)					User Contributed Perl Documentation					File::BaseDir(3pm)

NAME
File::BaseDir - Use the Freedesktop.org base directory specification SYNOPSIS
use File::BaseDir qw/xdg_data_files/; for ( xdg_data_files('mime/globs') ) { # do something } DESCRIPTION
This module can be used to find directories and files as specified by the Freedesktop.org Base Directory Specification. This specifications gives a mechanism to locate directories for configuration, application data and cache data. It is suggested that desktop applications for e.g. the Gnome, KDE or Xfce platforms follow this layout. However, the same layout can just as well be used for non-GUI applications. This module forked from File::MimeInfo. This module follows version 0.6 of BaseDir specification. EXPORT
None by default, but all methods can be exported on demand. Also the groups ":lookup" and ":vars" are defined. The ":vars" group contains all routines with a "xdg_" prefix; the ":lookup" group contains the routines to locate files and directories. METHODS
"new()" Simple constructor to allow Object Oriented use of this module. Lookup The following methods are used to lookup files and folders in one of the search paths. "data_home(@PATH)" Takes a list of file path elements and returns a new path by appending them to the data home directory. The new path does not need to exist. Use this when writing user specific application data. Example: # data_home is: /home/USER/.local/share $path = $bd->data_home('Foo', 'Bar', 'Baz'); # returns: /home/USER/.local/share/Foo/Bar/Baz "data_dirs(@PATH)" Looks for directories specified by @PATH in the data home and other data directories. Returns (possibly empty) list of readable directories. In scalar context only the first directory found is returned. Use this to lookup application data. "data_files(@PATH)" Looks for files specified by @PATH in the data home and other data directories. Only returns files that are readable. In scalar context only the first file found is returned. Use this to lookup application data. "config_home(@PATH)" Takes a list of path elements and appends them to the config home directory returning a new path. The new path does not need to exist. Use this when writing user specific configuration. "config_dirs(@PATH)" Looks for directories specified by @PATH in the config home and other config directories. Returns (possibly empty) list of readable directories. In scalar context only the first directory found is returned. Use this to lookup configuration. "config_files(@PATH)" Looks for files specified by @PATH in the config home and other config directories. Returns a (possibly empty) list of files that are readable. In scalar context only the first file found is returned. Use this to lookup configuration. "cache_home(@PATH)" Takes a list of path elements and appends them to the cache home directory returning a new path. The new path does not need to exist. Variables The following methods only returns the value of one of the XDG variables. "xdg_data_home" Returns either $ENV{XDG_DATA_HOME} or it's default value. Default is $HOME/.local/share. "xdg_data_dirs" Returns either $ENV{XDG_DATA_DIRS} or it's default value as list. Default is /usr/local/share, /usr/share. "xdg_config_home" Returns either $ENV{XDG_CONFIG_HOME} or it's default value. Default is $HOME/.config. "xdg_config_dirs" Returns either $ENV{XDG_CONFIG_DIRS} or it's default value as list. Default is /etc/xdg. "xdg_cache_home" Returns either $ENV{XDG_CACHE_HOME} or it's default value. Default is $HOME/.cache. NON-UNIX PLATFORMS The use of File::Spec ensures that all paths are returned in the apropriate form for the current platform. On Windows this module will try to set $HOME to a sensible value if it is not defined yet. On other platforms one can use e.g. File::HomeDir to set $HOME before loading File::BaseDir. Please note that the specification is targeting Unix platforms only and will only have limited relevance on other platforms. Any platform dependend behavior in this module should be considerd an extension of the spec. BACKWARDS COMPATIBILITY
The methods "xdg_data_files()" and "xdg_config_files()" are exported for backwards compatibility with version 0.02. They are identical to "data_files()" and "config_files()" respectively but without the "wantarray" behavior. BUGS
Please mail the author if you encounter any bugs. AUTHOR
Jaap Karssenberg || Pardus [Larus] <pardus@cpan.org> Copyright (c) 2003, 2007 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
<http://www.freedesktop.org/wiki/Specifications/basedir-spec> perl v5.10.1 2010-02-24 File::BaseDir(3pm)
Man Page