|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : Andrey Titov 2:5020/400 19 Jan 2002 19:34:56 To : Dmitry Smolin Subject : Re: Файл с русскими буквами - не текстовый. Почему? --------------------------------------------------------------------------------
> === Cut ===
> The "-T" and "-B" switches work as follows. The first block or
> so of the file is examined for odd characters such as strange
> control codes or _characters with the high bit set_. If too many
> strange characters (>30%) are found, it's a "-B" file, otherwise
> it's a "-T" file. Also, any file containing null in the first
> block is considered a binary file. If "-T" or "-B" is used on a
> filehandle, the current stdio buffer is examined rather than the
> first block. Both "-T" and "-B" return true on a null file, or a
> file at EOF when testing a filehandle. Because you have to read
> a file to do the "-T" test, on most occasions you want to use a
> "-f" against the file first, as in "next unless -f $file && -T
> $file".
> === Cut ===
Спасибо.
Заработало с -f:
if (-f $FILE) { ...
При этом с -e вылетает на ошибку.
Странно как-то.
--- ifmail v.2.15dev5
* Origin: MTU-Intel ISP (2:5020/400)
Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/9104488ea9a1.html, оценка из 5, голосов 10
|