【问题标题】:how to do getpwnam/getpwuid etc in tcl如何在 tcl 中执行 getpwnam/getpwuid 等
【发布时间】:2010-09-24 21:38:43
【问题描述】:

tcl 是否有进行 NSS 查找的标准方法(getpwnam、setpwent、...)

【问题讨论】:

    标签: tcl getpwnam


    【解决方案1】:

    Tcl 没有将它们公开为 API(它也没有真正在内部使用它们)但我相信 TclX 扩展包确实支持exactly what you want。例如:

    package require TclX
    
    set uid [id convert user $tcl_platform(user)]
    puts "Your userid is $uid and you are a member of these groups: [id groups]"
    

    如果您使用 ActiveTcl,那么您肯定已经获得了可用的 TclX 包(已经安装或可从茶壶存储库获得)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-21
      • 1970-01-01
      • 2012-10-09
      • 1970-01-01
      • 2016-03-11
      • 1970-01-01
      • 2016-01-01
      • 1970-01-01
      相关资源
      最近更新 更多