There's more than one way to do things | |
PerlMonks |
(RESOLVED): Filesys::SmbClient problemby natxo (Scribe) |
on Feb 13, 2014 at 10:10 UTC ( [id://1074777]=perlquestion: print w/replies, xml ) | Need Help?? |
natxo has asked for the wisdom of the Perl Monks concerning the following question:
in order to verify if the backups are running properly I want to check timestamps of some directories in a cifs share. I need to check this from a linux host and I nearly got it working using http://search.cpan.org/~alian/Filesys-SmbClient-3.1/SmbClient.pm If I hard code the share name, it works. I want to reuse the code allowing the share to be entered a the command line, and I hit a wall with the "$" character. In cifs (windows shares) "$" at the end of the share name means 'this share is hidden', so it is not discoverable using the Windows explorer (yes, security through obscurity). I need to check dirs in shares with or without '$" at the end of the share name. So using this code works: But this does not:
Obviously, something is going wrong with the share name conversion, but I do not see what. Any help greatly appreciated. Update: Finally resolved by using single quotes around the share name and removing the if loop that changed the sharename if it contained a $ sign. O well.
Back to
Seekers of Perl Wisdom
|
|