audfprint icon indicating copy to clipboard operation
audfprint copied to clipboard

Windows vs. LINUX

Open apiszcz opened this issue 10 years ago • 5 comments

audfprint appears to be Linux focused.

  1. audfprint_match.py resource and the log method geared towards *NIX. Here is a possible option for this issue: (requires psutil), not sure why function names are different ..
import os,platform,psutil

def process_info():
    rss=usrtime=0
    p=psutil.Process(os.getpid())
    if platform.system().lower()=='windows':
        rss=p.memory_info()[0]
        usrtime=p.cpu_times()[0]
    elif platform.system().lower()=='linux':
        rss=p.get_memory_info()[0]
        usrtime=p.get_cpu_times()[0]
    return rss,usrtime

if __name__ == "__main__":
    print process_info()
  1. Initial review of the filelist from the glob specification on the command line appears to want a list of files returned.
  2. There appears to be a problem with full windows path names. C:\fullpath... using the --list mode helps.

apiszcz avatar Jun 06 '15 13:06 apiszcz

audfprint.py DECIDED to use '--list' mode in which case windows file paths are supported.

apiszcz avatar Jun 06 '15 14:06 apiszcz

audfprint_match.py ***** TMP\AUDFPRINT-MASTER\AUDFPRINT-MASTER\audfprint_match.py 13: # for checking phys mem size 14: import resource 15: # for localtest and illustrate ***** LIB\AUDFPRINT\AUDFPRINT_MATCH.PY 13: # for checking phys mem size 14: #import resource 15: # for localtest and illustrate


***** TMP\AUDFPRINT-MASTER\AUDFPRINT-MASTER\audfprint_match.py 22: """ log info with stats """ 23: print time.ctime(),
24: "physmem=", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
25: "utime=", resource.getrusage(resource.RUSAGE_SELF).ru_utime,
26: message 27: ***** LIB\AUDFPRINT\AUDFPRINT_MATCH.PY 22: """ log info with stats """ 23: print time.ctime(), message 24: #print time.ctime(),
25: # "physmem=", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss,
26: # "utime=", resource.getrusage(resource.RUSAGE_SELF).ru_utime,
27: # message 28

apiszcz avatar Jun 06 '15 14:06 apiszcz

I actually do most development on MacOS, but that is much closer to Linux than Windows. I intend it to work unchanged on Linux, but I don't have access to a Windows machine. If there were simple way to support Windows without much noise, I'd be happy to accept a pull request.

dpwe avatar Nov 01 '15 02:11 dpwe

Understand. Since there are only a few changes and they are captured in this issue note, at the moment it is probably more valuable to spend your energy other topics. If I had the time, a PR that would support Windows and LINUX would be the way to go.

apiszcz avatar Nov 01 '15 11:11 apiszcz

https://github.com/dpwe/audfprint/pull/33

Hellowlol avatar Feb 23 '18 01:02 Hellowlol