Добавлена логика для работы с troff/groff файлами

This commit is contained in:
2026-04-15 16:57:55 +03:00
parent 7356fe4a3b
commit 52ad7be0de
6 changed files with 57 additions and 7 deletions

View File

@@ -76,7 +76,13 @@ namespace eval FileOper {
}
# линуксовый file не всегда корректно определяет тип файла
# используем пакет из tcl
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
if { $fType eq "text" && $fExt eq "troff"} {
set fType $fExt
set fBinaryType "text"
set fBinaryInterp "groff"
} else {
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
}
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp"
set ext [string tolower [file extension $fileFullPath]]
@@ -140,6 +146,9 @@ namespace eval FileOper {
}
}
}
"troff" {
return troff
}
"empty" {
return text
}
@@ -536,7 +545,7 @@ namespace eval FileOper {
set fileType [FileOper::GetFileMimeType $fileFullPath]
}
# puts "$fileType <<<<<<<<<<<"
DebugPuts "FileOper::Edit: file type is \"$fileType\""
switch $fileType {
"text" {