問題タブ [file-find]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
perl - ディレクトリから同様のファイル名のドキュメントを読み込む
会社の年次報告書のバッチがあり、それぞれ次の形式を使用して名前が付けられています: 会社 ID、2 桁の年、およびランダムな数字のセット (例: 00000217-12-00010.txt)。各年次提出書類の内容を、前年に同じ会社が提出した提出書類と比較したい (例: 000002178-12-00005.txt と比較した 000002178-13-00010.txt)。各ファイルをループするとき、各ドキュメントの前年の出願を特定して、両方のドキュメントを別々の文字列として読み取るにはどうすればよいでしょうか?
perl - Perl: How to use File::Find::Rule to list all symbolic links from a given path
ls /foo/bar/
lrwxr-xr-x a1 -> ../../../a1
lrwxr-xr-x a2 -> ../../../a2
lrwxr-xr-x a3 -> ../../../a3
This is a curtailed output of ls.
My goal: 1. Go to /foo/bar/ and find the latest version of a (which is a symbolic link). So in this case, a3. Copy the contents of a3 to a temp location
I am trying to use File::Find::Rule
but I am unable to figure out how to use it to list all the symbolic links. Reading through various Google sites, I see people explaining how to follow the symbolic links but not to list them.
What I have figured out so far:
my $filePath = "/foo/bar";
my @files = File::Find::Rule->file->in(filePath);
This returns an empty array because there there are no files only symbolic links in /foo/bar.
I also tried
my @files = File::Find::Rule->in($makeFilePath)->extras({follow =>1});
but I feel that is asks to follow the symbolic link rather than list them.