wildcard

Using a wildcard in php unlink

≡放荡痞女 提交于 2020-08-27 22:30:27
问题 I am currently making a php script to graph a bunch of data from a DB, arrange it into text files and then run a GNUPlot script to generate graphs. I have all of this working , now all I need to do is delete the text files I don't need anymore. What I have been trying was gotten from another thread on a different forum: foreach( glob('US_A.2.6.*') as $file ) { unlink($file); } The problem, however, is that it doesn't work. The files have complex end names: US_A.2.6.1.1a.txt US_A.2.6.1.2a.txt

Using a wildcard in php unlink

吃可爱长大的小学妹 提交于 2020-08-27 22:29:28
问题 I am currently making a php script to graph a bunch of data from a DB, arrange it into text files and then run a GNUPlot script to generate graphs. I have all of this working , now all I need to do is delete the text files I don't need anymore. What I have been trying was gotten from another thread on a different forum: foreach( glob('US_A.2.6.*') as $file ) { unlink($file); } The problem, however, is that it doesn't work. The files have complex end names: US_A.2.6.1.1a.txt US_A.2.6.1.2a.txt

Using a wildcard in php unlink

时间秒杀一切 提交于 2020-08-27 22:29:03
问题 I am currently making a php script to graph a bunch of data from a DB, arrange it into text files and then run a GNUPlot script to generate graphs. I have all of this working , now all I need to do is delete the text files I don't need anymore. What I have been trying was gotten from another thread on a different forum: foreach( glob('US_A.2.6.*') as $file ) { unlink($file); } The problem, however, is that it doesn't work. The files have complex end names: US_A.2.6.1.1a.txt US_A.2.6.1.2a.txt

Using PHP ftp_get() to retrieve file with wildcard filename

吃可爱长大的小学妹 提交于 2020-07-03 03:43:11
问题 I have a file on an FTP with a dynamic filename. The schema looks something like: ABCD_2_EFGH_YYMMDD_YYMMDD_randomnumber_.TXT The dates ( YYMMDD ) reflect the previous day and current day and the randomnumber value is a count of the records in the file and varies each day. I am attempting to retrieve the file using PHP but I am having trouble using a wildcard name. Here is a sample of the code: <?php $yesterday = strtotime('-1 day', time()); $today = strtotime('-0 day', time()); $local_file =

bash wildcard n digits

☆樱花仙子☆ 提交于 2020-06-22 23:26:20
问题 So I've got the following files in the tmp directory: file.0 file.1 file.t9 file.22 file.4444 if I wanted to list only the files that end in '.digits' (0, 1, 22, 4444) but not (t9) I could try and use wildcards such as this: ls tmp/file.{[0-9],[0-9][0-9],[0-9][0-9][0-9],[0-9][0-9][0-9][0-9]} however I get the following results with the ugly error ls: cannot access tmp/file.[0-9][0-9][0-9][0-9]: No such file or directory file.0 file.1 file.22 file.4444 I've also tried using {0..999} but that