perl - The folder shows 3 files but when run the script in CMD it shows extra ` . ` and ` .. `? -
I have been confused with the situation below, instead of Code: Play Perl: Only 3 files inside my folder were found, but it prints 5 records in CMD. Why is update : Thanks minitech and chilemagic then Additional questions: How can I only show the file, so that I This is a common thing to filter by calling: Or if you are ok with full path information, you can use one, in which size = 3 5 only got 3 files in my folder as ?
. and
.. from where?
My $ directory = 'c: \ modules \ SFTP \ New'; Opendir (DIR, $ directory); My @ fils = reddir (dir); Closedir (DIR); Foreign (@file) {print $ _, "\ n"; } My $ size = @files; Print "Size - $ Size \ n";
. and
.. to show in CMD?
. and
.. is the current directory and the original directory.
size = 3 If there is no other way, then maybe I should do it manually in a manual way.
. and
.. are the current and root directories respectively.
Use strict; Use warnings; Use Autodi; My $ directory = 'c: \ modules \ SFTP \ New'; My @ files = {opendir my $ dh, "$ directory"; Grep {! /^..+$/} reader ($ dh); };
will not be included. and
.. .
My @ file = globe ("$ directory \\ *")
Comments
Post a Comment