Get all files in a given directory non recursively - possible bug?
Hey guys,
I'm writing here because I've been stuck on this one task for a couple of hours now and I'm getting desperate. Any help would be greatly appreciated.
I have the following directory structure on a FTP server:
root --|- QA
.........|
.........|- SPH --|- Josh --|- JoshFile.zip
.........|.............|- SPH1.zip
.........|.............|- SPH2.zip
.........|
.........|- Josh--|- AnotherJoshFile.zip
.........|
.........|- RootFile1.zip
.........|- RootFile2.zip
.........|- RootFile3.zip
Everything which has an extension ".zip" is a file; everything else - folder.
The goal is to get all the files in the folder "SPH" but not recursively - only the files in that particular folder, i.e "SPH1.zip" and "SPH2.zip".
I can only navigate from the root of the directory.
Naturally I tried with the following filepath mask:
/SPH/*.zip | /SPH/*/
However, that didn't produce the correct results - yes I would get only the .zip files from that directory("SPH1.zip" and "SPH2.zip"), but I would also get the folders "QA","Josh" and "SPH/Josh" - as empty folders. Though empty - this is of no use to me. I need only the files and nothing else. No empty folders allowed.
I tried specifying the filemask as directory mask, ie:
/SPH/ | /SPH/*/
This doesn't return any extra folders, but it retuns all the files in the root directory - RootFile1,2,3.zip
I've tried specifying the absolute paths together with numerous combinations of the methods above with no luck.
Any advice is welcome!
P.S the files SPH1.zip and SPH2.zip have the following path: /root/SPH/SPH1.zip and /root/SPH/SPH2.zip . Had to draw the dots because the original whitespaces were getting trunked by the site
I'm writing here because I've been stuck on this one task for a couple of hours now and I'm getting desperate. Any help would be greatly appreciated.
I have the following directory structure on a FTP server:
root --|- QA
.........|
.........|- SPH --|- Josh --|- JoshFile.zip
.........|.............|- SPH1.zip
.........|.............|- SPH2.zip
.........|
.........|- Josh--|- AnotherJoshFile.zip
.........|
.........|- RootFile1.zip
.........|- RootFile2.zip
.........|- RootFile3.zip
Everything which has an extension ".zip" is a file; everything else - folder.
The goal is to get all the files in the folder "SPH" but not recursively - only the files in that particular folder, i.e "SPH1.zip" and "SPH2.zip".
I can only navigate from the root of the directory.
Naturally I tried with the following filepath mask:
/SPH/*.zip | /SPH/*/
However, that didn't produce the correct results - yes I would get only the .zip files from that directory("SPH1.zip" and "SPH2.zip"), but I would also get the folders "QA","Josh" and "SPH/Josh" - as empty folders. Though empty - this is of no use to me. I need only the files and nothing else. No empty folders allowed.
I tried specifying the filemask as directory mask, ie:
/SPH/ | /SPH/*/
This doesn't return any extra folders, but it retuns all the files in the root directory - RootFile1,2,3.zip
I've tried specifying the absolute paths together with numerous combinations of the methods above with no luck.
Any advice is welcome!
P.S the files SPH1.zip and SPH2.zip have the following path: /root/SPH/SPH1.zip and /root/SPH/SPH2.zip . Had to draw the dots because the original whitespaces were getting trunked by the site