Re: [MacPerl] parsing files in a directory

2001-06-14 Thread John W Baxter
At 16:45 +0200 6/13/2001, Bart Lateur wrote: >And "." doesn't exist on the Mac, I would think. It's not special, if it >does. A leading . on a file name was *once* special on Mac: it meant (except when misused) "I am a driver". [The system had a tendency to try to execute such files as drivers

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Katherine Richmond
Yes, I see your point. Even though my solution was not perfect, it got that one job done. I'm learning! --- Bart Lateur wrote: On 13 Jun 2001 10:47:50 EDT, Katherine Richmond wrote: >I'm missing the newline? I took care of that with chomp. And I looked at the >filenames that were in my directo

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Bart Lateur
On 13 Jun 2001 10:47:50 EDT, Katherine Richmond wrote: >I'm missing the newline? I took care of that with chomp. And I looked at the >filenames that were in my directory, and there was a . file. But "Icon", without the newline, is not a reserved name. You can create a file or folder with that n

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Katherine Richmond
I'm missing the newline? I took care of that with chomp. And I looked at the filenames that were in my directory, and there was a . file. --- Bart Lateur wrote: On 13 Jun 2001 07:49:08 EDT, Katherine Richmond wrote: > if ( ($fileName ne "Icon") && ($fileName ne ".")) { That ain't right

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Bart Lateur
On 13 Jun 2001 07:49:08 EDT, Katherine Richmond wrote: > if ( ($fileName ne "Icon") && ($fileName ne ".")) { That ain't right. You're missing the newline in the filename! Since you're responding to Thomas, I find that surprising, since it was a large, important part in his post. And "."

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Bill Becker
I always insert this in any Perl script that works with directories: $fil = @dir[$i]; if ($fil =~ /^Icon/) (Where @dir is set from a READDIR instruction) >actually, "Icon\015" (octal, I prefer this) or "Icon\x0D" >(hexadecimal) -- but not "Icon\0x0D", that's wrong in Perl -- is a >plai

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Katherine Richmond
Hi Thomas, I did some reading and learned about the file tests. Thank you very much for the information about the Mac file system. Since I know that my files will always be in a certain folder on my disk, I think I am safe with this code: - my $parseDir = "Kata

Re: [MacPerl] parsing files in a directory

2001-06-13 Thread Thomas Wegner
At 14:47 Uhr -0500 12.06.2001, Randy Boring wrote: >>I figured out my errors with the file list. One of the problems is that >>there is >>an invisible MPW icon the the directory. What is that? The file name is Icon. >>Another problem is that I needed to chomp the fileName before using it. Why >>w

Re: [MacPerl] parsing files in a directory

2001-06-12 Thread Randy Boring
>I figured out my errors with the file list. One of the problems is that >there is >an invisible MPW icon the the directory. What is that? The file name is Icon. >Another problem is that I needed to chomp the fileName before using it. Why >would I have to do that? Kathy, Wiser Perlers than myse

[MacPerl] parsing files in a directory

2001-06-12 Thread Katherine Richmond
I figured out my errors with the file list. One of the problems is that there is an invisible MPW icon the the directory. What is that? The file name is Icon. Another problem is that I needed to chomp the fileName before using it. Why would I have to do that? Thanks, Kathy Here is the code I am