file-listing

List files with multiple conditions part2

不羁岁月 提交于 2020-01-04 02:11:07
问题 I have the following rasters and would like to import them in R. My files are now called: B02_10m.jp2 B03_10m.jp2 B04_10m.jp2 B08_10m.jp2 B05_20m.jp2 B06_20m.jp2 B07_20m.jp2 B8A_20m.jp2 B11_20m.jp2 B12_20m.jp2 They are located in different sub-folders. That's way I am using recursive=TRUE I have trying with the following options to combine the conditions but it's not working. S2 <- "my/path" S2 <- list.files(S2, recursive = TRUE, full.names = TRUE, pattern = "B0[2348]_10m.jp2$ | B(0[567]_20m)

save file listing into array or something else C

£可爱£侵袭症+ 提交于 2019-12-31 07:09:07
问题 I have this function void file_listing(){ DIR *dp; struct stat fileStat; struct dirent *ep; int file=0; dp = opendir ("./"); if (dp != NULL){ while ((ep = readdir(dp))){ char *c = ep->d_name; char d = *c; /* first char */ if((file=open(ep->d_name,O_RDONLY)) < -1){ perror("Errore apertura file"); } if(fstat(file,&fileStat)){ /*file info */ perror("Errore funzione fstat"); } if(S_ISDIR(fileStat.st_mode)){ /* directory NOT listed */ continue; } else{ if(d != '.'){ /* if filename DOESN'T start

save file listing into array or something else C

天大地大妈咪最大 提交于 2019-12-31 07:09:07
问题 I have this function void file_listing(){ DIR *dp; struct stat fileStat; struct dirent *ep; int file=0; dp = opendir ("./"); if (dp != NULL){ while ((ep = readdir(dp))){ char *c = ep->d_name; char d = *c; /* first char */ if((file=open(ep->d_name,O_RDONLY)) < -1){ perror("Errore apertura file"); } if(fstat(file,&fileStat)){ /*file info */ perror("Errore funzione fstat"); } if(S_ISDIR(fileStat.st_mode)){ /* directory NOT listed */ continue; } else{ if(d != '.'){ /* if filename DOESN'T start

In Git, how do I get a detailed list of file changes from one revision to another?

久未见 提交于 2019-12-17 22:41:56
问题 I use a Git repository on my server to version user data files sent to the server. I'm interested in getting a list of changed files between any two revisions. I know about git diff --name-only <rev1> <rev2> , but this only gives me a list of file names. I'm especially interested in renames and copies, too. Ideally, the output would be something like this: updated: userData.txt renamed: picture.jpg -> background.jpg copied: song.mp3 -> song.mp3.bkp Is it possible? --name-status also doesn't

Why can File.listFiles return null when called on a directory?

蹲街弑〆低调 提交于 2019-12-10 13:47:05
问题 I'm creating an Android app, and I want to list the files in a directory. I do this by calling File[] files = path.listFiles(new CustomFileFilter()); path is a File object, which is created by calling File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); When I then try to get the length of the files array by calling int length = files.length; This line gives me a NullPointerException , because files is null. I have checked if the path which I try to list

save file listing into array or something else C

早过忘川 提交于 2019-12-02 11:57:07
I have this function void file_listing(){ DIR *dp; struct stat fileStat; struct dirent *ep; int file=0; dp = opendir ("./"); if (dp != NULL){ while ((ep = readdir(dp))){ char *c = ep->d_name; char d = *c; /* first char */ if((file=open(ep->d_name,O_RDONLY)) < -1){ perror("Errore apertura file"); } if(fstat(file,&fileStat)){ /*file info */ perror("Errore funzione fstat"); } if(S_ISDIR(fileStat.st_mode)){ /* directory NOT listed */ continue; } else{ if(d != '.'){ /* if filename DOESN'T start with . will be listed */ "save into someting" (ep->d_name); } else{ continue; /* altrimenti non lo listo

List files of certain pattern using Excel VBA

旧时模样 提交于 2019-12-02 10:23:35
问题 How to list all the files which match a certain pattern inside a user specified directory? This should work recursively inside the sub folders of the selected directory. I also need a convenient way(like tree control) of listing them. 回答1: It appears that a couple answers talk about recursion, and one about regex. Here's some code that puts the two topics together. I grabbed the code from http://vba-tutorial.com Sub FindPatternMatchedFiles() Dim objFSO As Object Set objFSO = CreateObject(

List files of certain pattern using Excel VBA

南楼画角 提交于 2019-12-02 05:17:37
How to list all the files which match a certain pattern inside a user specified directory? This should work recursively inside the sub folders of the selected directory. I also need a convenient way(like tree control) of listing them. It appears that a couple answers talk about recursion, and one about regex. Here's some code that puts the two topics together. I grabbed the code from http://vba-tutorial.com Sub FindPatternMatchedFiles() Dim objFSO As Object Set objFSO = CreateObject("Scripting.FileSystemObject") Dim objRegExp As Object Set objRegExp = CreateObject("VBScript.RegExp") objRegExp

Echo each file in Fileset with size, date and time

我的梦境 提交于 2019-11-29 15:27:16
I'm converting a DOS batch file to Ant. At the end of the batch file, I print out a list of files copied including size, date and time using the DOS dir command. I would like to do the same at the end of the Ant script. So far I have: <!-- LIST COPIED FILES --> <target name="summary" depends="backup"> <fileset id="zipfiles" dir="${dest}" casesensitive="yes"> <include name="*.zip"/> </fileset> <property name="prop.zipfiles" refid="zipfiles"/> <echo>${prop.zipfiles}</echo> </target> How can I modify the above to print each file on a separate line, with size, date and time? There is a solution

R list files with multiple conditions

十年热恋 提交于 2019-11-29 02:29:13
问题 I want to list all files in a directory that met certain conditions (date and currency). So with only one condition the argument pattern in list.files works well: file.ls <- list.files(path='~/DATA/PiP/Curvas/',pattern='20130801') For multiple conditions I've tried: file.ls <- list.files(path='~/DATA/PiP/Curvas/',pattern=c('20130801','USD')) But had the same result as the first one. Is there a way to have multiple criteria in pattern argument of list.files ? 回答1: Filter(function(x) grepl("USD