]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.0.1
authorfred <fred>
Wed, 1 Jul 1998 06:34:39 +0000 (06:34 +0000)
committerfred <fred>
Wed, 1 Jul 1998 06:34:39 +0000 (06:34 +0000)
stepmake/bin/ntpwd.py [new file with mode: 0644]

diff --git a/stepmake/bin/ntpwd.py b/stepmake/bin/ntpwd.py
new file mode 100644 (file)
index 0000000..a656a8d
--- /dev/null
@@ -0,0 +1,29 @@
+"""Winnt access into /etc/passwd via account name"""
+
+import sys
+import string
+
+def getpwname( name, pwfile='/etc/passwd' ):
+    "Get password record that matches the specified name"
+    try:
+        _fd = open( pwfile, 'r' )
+    except:
+        sys.stderr.write("Error unable to locate" + pwfile + "\n")
+        sys.stderr.write("Consult gnu-win32 command mkpasswd\n")
+        sys.exit(1)
+
+    _data = _fd.read()
+    _fd.close()
+        
+    for _line in string.split(_data, '\n'):
+        _record=string.split( _line, ':' );
+        if _record[0] == name:
+            return _record
+    return ()
+
+def _test():
+    pw = getpwname( 'jeff' )
+    print pw[4]
+
+if __name__ == '__main__':
+       _test()