I have a directory structure as shown below.
MainFolder | [lib] / | \ [A] [B] [C]
I am trying to find the "lib" folder in this structure, which may sometimes be missing. Therefore, I use the following to check for the existence of the "lib" folder:
if os.path.isdir(apkLocation + apkFolder + '/lib/'):
If the lib folder exists, I continue to search for folders inside 'lib'. I have to store the folder names A, B and C and look for files ending in ".so", the path of which should be stored as / lib / A / file 1.so, / lib / A / file2.so and so on.
if os.path.isdir(apkLocation + apkFolder + '/lib/'): for root, dirs, files in os.walk(apkLocation + apkFolder): for name in files: if name.endswith(("lib", ".so")): print os.path.abspath(name)
It gives me a way out
file1.so file2.so file1.so file2.so file1.so file2.so
Required Conclusion:
/lib/A/file1.so /lib/A/file2.so /lib/B/file1.so /lib/B/file2.so /lib/C/file1.so /lib/C/file2.so
as well as folders A, B and C must be saved separately.
source share