On 24.10.2012 14:07, Sverre Moe wrote:
>
> I have come up with the following hack for names over 64 characters. I'm not 
> sure if this hack is a very good solution. 
>
> Truncate in the middle with the number of characters over 64 (+2) and replace 
> it with "-".
>
>
> std::string tmp_string = name;
> const int length = tmp_string.length();
> if (length > 64) { 
>
>   const int half = length / 2; //We truncate in the middle.
>
>   const int numberOff = (length - 64) + 2; //The number of characters to 
> truncate.
>   const std::string dash = "-";
>   tmp_string = tmp_string.replace(half, numberOff, dash);
> }
>
>

Sverre,

the stuff you seem to want to do with a MIB scares the hell out of  me ;-) ... 
Not sure what you want to achieve with that
(creating an SNMP file system). However, maybe you should take the MD5 hash of 
the full path (echo $FILENAME | md5sum) and
use it as the name of the object and (for better readability....) add a comment 
"-- this is file /etc/hosts --" or something
similar that helps you to find out which object is which file ...

Again: for all the possible things that I could come up with as a reason why 
you are doing this, I would see a better
(non-MIB "abusing" :-)) alternative. But: what do I know :-)

Regards,
 Heiko

P.S.: ...
> CONFIDENTIALITY
> This e-mail and any attachment contain KONGSBERG information which may be
> proprietary, confidential or subject to export regulations, and is only meant
> for the intended recipient(s). Any disclosure, copying, distribution or use is
> prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
> error, please delete it immediately from your system and notify the sender
> properly.
[insert rant about privacy disclaimers in mailing list / newsletter posts here]


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to