F
Fernando Armenta
Hello!
I am new to Python and I would like to write the following code:
I need to check for a directory and move it to other directory if is
found. The directory always starts with outlog.XYZ and ends in XYZ
(where XYZ are variables). I need to use wild characters. Here is what
I have, but is not working. Any help would be appreciated.
#Path for the file
home_trace = "/home/testeng/ca/tds/outlog.* "
#Path for the directory where I want to move the file
directory = "/home/testeng/ca/tds/unattached"
#If statement
if os.path.exists(home_trace):
os.system ("chmod -fR 775 outlog.* ")
os.system ("mv outlog.* " + directory)
Fernando Armenta
I am new to Python and I would like to write the following code:
I need to check for a directory and move it to other directory if is
found. The directory always starts with outlog.XYZ and ends in XYZ
(where XYZ are variables). I need to use wild characters. Here is what
I have, but is not working. Any help would be appreciated.
#Path for the file
home_trace = "/home/testeng/ca/tds/outlog.* "
#Path for the directory where I want to move the file
directory = "/home/testeng/ca/tds/unattached"
#If statement
if os.path.exists(home_trace):
os.system ("chmod -fR 775 outlog.* ")
os.system ("mv outlog.* " + directory)
Fernando Armenta