⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 file::homedir.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 2 页
字号:
If the distinction is important to you, the term \*(L"current\*(R" refers to thereal user, and not the effective user..PPThis is also the case for all of the other \*(L"my\*(R" methods..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a home directory, or dies on error..Sh "my_desktop".IX Subsection "my_desktop"The \f(CW\*(C`my_desktop\*(C'\fR method takes no arguments and returns the \*(L"desktop\*(R"directory for the current user..PPDue to the diversity and complexity of implementions required to deal withimplementing the required functionality fully and completely, for the moment\&\f(CW\*(C`my_desktop\*(C'\fR is \fBnot\fR going to be implemented..PPThat said, I am extremely interested in code to implement \f(CW\*(C`my_desktop\*(C'\fR onUnix, as long as it is capable of dealing (as the Windows implementationdoes) with internationalisation. It should also avoid false positiveresults by making sure it only returns the appropriate directories for theappropriate platforms..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a desktop directory, or dies on error..Sh "my_documents".IX Subsection "my_documents"The \f(CW\*(C`my_documents\*(C'\fR method takes no arguments and returns the directory (forthe current user) where the user's documents are stored..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a documents directory, or dies on error..Sh "my_music".IX Subsection "my_music"The \f(CW\*(C`my_music\*(C'\fR method takes no arguments and returns the directorywhere the current user's music is stored..PPNo bias is made to any particular music type or music program, rather theconcept of a directory to hold the user's music is made at the level of theunderlying operating system or (at least) desktop environment..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a suitable directory, or dies on error..Sh "my_pictures".IX Subsection "my_pictures"The \f(CW\*(C`my_pictures\*(C'\fR method takes no arguments and returns the directorywhere the current user's pictures are stored..PPNo bias is made to any particular picture type or picture program, rather theconcept of a directory to hold the user's pictures is made at the level of theunderlying operating system or (at least) desktop environment..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a suitable directory, or dies on error..Sh "my_videos".IX Subsection "my_videos"The \f(CW\*(C`my_videos\*(C'\fR method takes no arguments and returns the directorywhere the current user's videos are stored..PPNo bias is made to any particular video type or video program, rather theconcept of a directory to hold the user's videos is made at the level of theunderlying operating system or (at least) desktop environment..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a suitable directory, or dies on error..Sh "my_data".IX Subsection "my_data"The \f(CW\*(C`my_data\*(C'\fR takes no arguments and returns the directory wherelocal applications should stored their internal data for the currentuser..PPGenerally an application would create a subdirectory such as \f(CW\*(C`.foo\*(C'\fR,beneath this directory, and store its data there. By creating yourdirectory this way, you get an accurate result on the maximum numberof platforms..PPFor example, on Unix you get \f(CW\*(C`~/.foo\*(C'\fR and on Win32 you get\&\f(CW\*(C`~/Local Settings/Application Data/.foo\*(C'\fR.PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if the current userdoes not have a data directory, or dies on error..Sh "users_home".IX Subsection "users_home".Vb 1\&  $home = File::HomeDir\->users_home(\*(Aqfoo\*(Aq);.Ve.PPThe \f(CW\*(C`users_home\*(C'\fR method takes a single param and is used to locate theparent home/profile directory for an identified user on the system..PPWhile most of the time this identifier would be some form of user name,it is permitted to vary per-platform to support user ids or UUIDs asapplicable for that platform..PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if that userdoes not have a home directory, or dies on error..Sh "users_documents".IX Subsection "users_documents".Vb 1\&  $docs = File::HomeDir\->users_documents(\*(Aqfoo\*(Aq);.Ve.PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if that userdoes not have a documents directory, or dies on error..Sh "users_data".IX Subsection "users_data".Vb 1\&  $data = File::HomeDir\->users_data(\*(Aqfoo\*(Aq);.Ve.PPReturns the directory path as a string, \f(CW\*(C`undef\*(C'\fR if that userdoes not have a data directory, or dies on error..SH "FUNCTIONS".IX Header "FUNCTIONS".Sh "home".IX Subsection "home".Vb 5\&  use File::HomeDir;\&  $home = home();\&  $home = home(\*(Aqfoo\*(Aq);\&  $home = File::HomeDir::home();\&  $home = File::HomeDir::home(\*(Aqfoo\*(Aq);.Ve.PPThe \f(CW\*(C`home\*(C'\fR function is exported by default and is provided forcompatibility with legacy applications. In new applications, you shoulduse the newer method-based interface above..PPReturns the directory path to a named user's home/profile directory..PPIf provided no param, returns the directory path to the current user'shome/profile directory..SH "TIED INTERFACE".IX Header "TIED INTERFACE".Sh "%~".IX Subsection "%~".Vb 7\&  $home = $~{""};\&  $home = $~{undef};\&  $home = $~{$user};\&  $home = $~{username};\&  print "... $~{\*(Aq\*(Aq} ...";\&  print "... $~{$user} ...";\&  print "... $~{username} ...";.Ve.PPThis calls \f(CW\*(C`home($user)\*(C'\fR or \f(CW\*(C`home(\*(Aqusername\*(Aq)\*(C'\fR \*(-- except that if youask for \f(CW$~{some_user}\fR and there is no such user, it will die..PPNote that this is especially useful in double-quotish strings, like:.PP.Vb 2\&     print "Jojo\*(Aqs .newsrc is ", \-s "$~{jojo}/.newsrc", "b long!\en";\&      # (helpfully dies if there is no user \*(Aqjojo\*(Aq).Ve.PPIf you want to avoid the fatal errors, first test the value of\&\f(CW\*(C`home(\*(Aqjojo\*(Aq)\*(C'\fR, which will return undef (instead of dying) in case ofthere being no such user..PPNote, however, that if the hash key is "\*(L" or undef (whether thru beinga literal \*(R"", or a scalar whose value is empty-string or undef), thenthis returns zero-argument \f(CW\*(C`home()\*(C'\fR, i.e., your home directory:.PPFurther, please note that because the %~ hash compulsorily modifiesa hash outside of it's namespace, and presents an overly simplisticapproach to home directories, it is likely to ultimately be removed..PPThe interface is currently expected to be formally deprecated from 2010(but no earlier) and removed from 2015 (but no earlier). If very heavyuse is found in the wild, these plans may be pushed back..SH "TO DO".IX Header "TO DO".IP "\(bu" 4Become generally clearer on situations in which a user might nothave a particular resource..IP "\(bu" 4Merge remaining edge case code in File::HomeDir::Win32.IP "\(bu" 4Add more granularity to Unix, and add support to \s-1VMS\s0 and otheresoteric platforms, so we can consider going core..IP "\(bu" 4Add consistent support for users_* methods.SH "SUPPORT".IX Header "SUPPORT"This module is stored in an Open Repository at the following address..PP<http://svn.ali.as/cpan/trunk/File\-HomeDir>.PPWrite access to the repository is made available automatically to anypublished \s-1CPAN\s0 author, and to most other volunteers on request..PPIf you are able to submit your bug report in the form of new (failing)unit tests, or can apply your fix directly instead of submitting a patch,you are \fBstrongly\fR encouraged to do so as the author currently maintainsover 100 modules and it can take some time to deal with non-Critical bugreports or patches..PPThis will guarantee that your issue will be addressed in the nextrelease of the module..PPIf you cannot provide a direct test or fix, or don't have time to do so,then regular bug reports are still accepted and appreciated via the \s-1CPAN\s0bug tracker..PP<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File\-HomeDir>.PPFor other issues, for commercial enhancement or support, or to have yourwrite access enabled for the repository, contact the author at the emailaddress above..SH "ACKNOWLEDGEMENTS".IX Header "ACKNOWLEDGEMENTS"The biggest acknowledgement must go to Chris Nandor, who wielded hislegendary Mac-fu and turned my initial fairly ordinary Darwinimplementation into something that actually worked properly everywhere,and then donated a Mac \s-1OS\s0 X license to allow it to be maintained properly..SH "AUTHORS".IX Header "AUTHORS"Adam Kennedy <adamk@cpan.org>.PPSean M. Burke <sburke@cpan.org>.PPChris Nandor <cnandor@cpan.org>.PPStephen Steneker <stennie@cpan.org>.SH "SEE ALSO".IX Header "SEE ALSO"File::ShareDir, File::HomeDir::Win32 (legacy).SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright 2005, 2006 Adam Kennedy..PPSome parts copyright 2000 Sean M. Burke..PPSome parts copyright 2006 Chris Nandor..PPSome parts copyright 2006 Stephen Steneker..PPThis program is free software; you can redistributeit and/or modify it under the same terms as Perl itself..PPThe full text of the license can be found in the\&\s-1LICENSE\s0 file included with this module.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -