예제 #1
0
def drive(loc):
    import glob
    import avail

    drives=(avail.get_available_drives())
    if loc[0] not in drives:
        print ("drive not found")
        quit()

    if os.path.exists("D:\\index\\index") == True:
        os.remove("D:\\index\\index")

    os.chdir(loc)
    log = open("D:\\index\\index", "a")
    for files in glob.glob("*.*"):
        print(files, file = log)

    os.path
    dir = (loc)
    os.chdir(dir)
    for root, dirs, files in os.walk(dir):
        for f in files:
            fullpath = os.path.join(root, f)
            print (fullpath, file = log)
           # print (stat_e.s1(fullpath))
예제 #2
0
import avail
import index
import search
import os
import sys
import shutil

print "Drives detected: %s" % (avail.get_available_drives())

loc = avail.get_available_drives()
loc2 = avail.get_available_drives()

if os.path.exists("D:\\index") == False:
    os.mkdir("D:\\index")

arglen = len(sys.argv)

if arglen >= 2:  #command line options
    arg1 = sys.argv[1]
    if arg1 == 's':
        search.search()
        quit()
    if arg1 == 'f':
        index.all(loc, loc2)
    if arg1 == 'd' and len(sys.argv) >= 3:
        index.drive(sys.argv[2])
        print "Complete"
        quit()
    if arg1 == 'b':  #backup option
        if arglen == 2:
            print "\nBacking up... \n"
예제 #3
0
파일: Main.py 프로젝트: DMCristallo/search
import avail
import index
import search
import os
import sys
import shutil

print "Drives detected: %s" % (avail.get_available_drives())

loc = avail.get_available_drives()
loc2= avail.get_available_drives()

if os.path.exists("D:\\index") == False:
    os.mkdir("D:\\index")

arglen=len(sys.argv)

if arglen>=2: #command line options
    arg1 = sys.argv[1]
    if arg1=='s':
        search.search()
        quit()
    if arg1=='f':
        index.all(loc,loc2)
    if arg1=='d' and len(sys.argv)>=3:
        index.drive(sys.argv[2])
        print "Complete"
        quit()
    if arg1=='b':#backup option
        if arglen == 2:
            print "\nBacking up... \n"