diff --git a/src/doc/punk/_module_fileline-0.1.0.tm.man b/src/doc/punk/_module_fileline-0.1.0.tm.man
new file mode 100644
index 00000000..be45f826
--- /dev/null
+++ b/src/doc/punk/_module_fileline-0.1.0.tm.man
@@ -0,0 +1,146 @@
+[comment {--- punk::docgen generated from inline doctools comments ---}]
+[comment {--- punk::docgen DO NOT EDIT DOCS HERE UNLESS YOU REMOVE THESE COMMENT LINES ---}]
+[comment {--- punk::docgen overwrites this file ---}]
+[manpage_begin punkshell_module_punk::fileline 0 0.1.0]
+[copyright "2024"]
+[titledesc {file line-handling utilities}] [comment {-- Name section and table of contents description --}]
+[moddesc {punk fileline}] [comment {-- Description at end of page heading --}]
+[require punk::fileline]
+[keywords module text parse file]
+[description]
+[para] -
+[section Overview]
+[para]Utilities for in-memory analysis of text file data as both line data and byte/char-counted data whilst preserving the line-endings (even if mixed)
+[para]This is important for certain text files where examining the number of chars/bytes is important
+[para]For example - windows .cmd/.bat files need some byte counting to determine if labels lie on chunk boundaries and need to be moved.
+[para]Despite including the word 'file', the library doesn't deal with reading/writing to the filesystem. It is for operating on text-file like data.
+[subsection Concepts]
+[para]A chunk of textfile data (possibly representing a whole file - but usually at least a complete set of lines) is loaded into a punk::fileline::class::textinfo instance at object creation.
+[example_begin]
+ package require punk::fileline
+ package require fileutil
+ set rawdata [lb]fileutil::cat data.txt -translation binary[rb]
+ punk::fileline::class::textinfo create obj_data $rawdata
+ puts stdout [lb]obj_data linecount[rb]
+[example_end]
+[subsection Notes]
+[para]Line records are referred to by a zero-based index instead of a one-based index as is commonly used when displaying files.
+[para]This is for programming consistency and convenience, and the module user should do their own conversion to one-based indexing for line display or messaging if desired.
+[para]No support for lone carriage-returns being interpreted as line-endings.
+[para]CR line-endings that are intended to be interpreted as such should be mapped to something else before the data is supplied to this module.
+[subsection dependencies]
+[para] packages used by punk::fileline
+[list_begin itemized]
+[item] [package {Tcl 8.6}]
+[list_end]
+[section API]
+[subsection {Namespace punk::fileline::class}]
+[para] class definitions
+[list_begin enumerated]
+[enum] CLASS [class textinfo]
+[list_begin definitions]
+ [para] [emph METHODS]
+[call class::textinfo [method constructor] [arg datachunk] [opt {option value...}]]
+[para] Constructor for textinfo object which represents a chunk or all of a file
+[para] datachunk should be passed with the file data including line-endings as-is for full functionality. ie use something like:
+[example_begin]
+ fconfigure $fd -translation binary
+ set chunkdata [lb]read $fd[rb]]
+or
+ set chunkdata [lb]fileutil::cat -translation binary[rb]
+[example_end]
+[para] when loading the data
+[call class::textinfo [method chunk] [arg chunkstart] [arg chunkend]]
+[para]Return a range of bytes from the underlying raw chunk data.
+[para] e.g The following retrieves the entire chunk
+[para] objName chunk 0 end
+[call class::textinfo [method chunklen]]
+[para] Number of bytes/characters in the raw data of the file
+[call class::textinfo [method linecount]]
+[para] Number of lines in the raw data of the file, counted as per the policy in effect
+[call class::textinfo [method regenerate_lines]]
+[para]generate a list of lines from the stored raw data chunk and keep a map of line-endings indexed by lineindex
+[call class::textinfo [method line] [arg lineindex]]
+[para]Reconstructs and returns the raw line using the payload and per-line stored line-ending metadata
+[para]A 'line' may be returned without a line-ending if the unerlying chunk had trailing data without a line-ending (or the chunk was loaded under a non-standard -policy setting)
+[para]Whilst such data may not conform to definitions (e.g POSIX) of the terms 'textfile' and 'line' - it is useful here to represent it as a line with metadata le set to "none"
+[para]To return just the data which might more commonly be needed for dealing with lines, use the [method linepayload] method - which returns the line data minus line-ending
+[call class::textinfo [method linepayload] [arg lineindex]]
+[para]Return the text of the line indicated by the zero-based lineindex
+[para]The line-ending is not returned in the data - but is still stored against this lineindex
+[para]Line Metadata such as the line-ending for a particular line and the byte/character range it occupies within the chunk can be retrieved with the [method linemeta] method
+[para]To retrieve both the line text and metadata in a single call the [method lineinfo] method can be used
+[para]To retrieve an entire line including line-ending use the [method line] method.
+[call class::textinfo [method linemeta] [arg lineindex]]
+[para]Return a dict of the metadata for the line indicated by the zero-based lineindex
+[para]Keys returned include
+[list_begin itemized]
+[item] le
+[para] A string representing the type of line-ending: crlf|lf|none
+[item] linelen
+[para] The number of characters/bytes in the whole line including line-ending if any
+[item] payloadlen
+[para] The number of character/bytes in the line excluding line-ending
+[item] start
+[para] The zero-based index into the associated raw file data indicating at which byte/character index this line begins
+[item] end
+[para] The zero-based index into the associated raw file data indicating at which byte/character index this line ends
+[para] This end-point corresponds to the last character of the line-ending if any - not necessarily the last character of the line's payload
+[list_end]
+[call class::textinfo [method lineinfo] [arg lineindex]]
+[para]Return a dict of the metadata and text for the line indicated by the zero-based lineindex
+[para]This returns the same info as the [method linemeta] with an added key of 'payload' which is the text of the line without line-ending.
+[para]The 'payload' value is the same as is returned from the [method linepayload] method.
+[call class::textinfo [method linerange_to_chunkrange] [arg startidx] [arg endidx]]
+[call class::textinfo [method linerange_to_chunk] [arg startidx] [arg endidx]]
+[call class::textinfo [method lines] [arg startidx] [arg endidx]]
+[call class::textinfo [method linepayloads] [arg startidx] [arg endidx]]
+[call class::textinfo [method chunkrange_to_linerange] [arg chunkstart] [arg chunkend]]
+[call class::textinfo [method chunkrange_to_lineinfolist] [arg chunkstart] [arg chunkend] [opt {option value...}]]
+[para]Return a list of dicts each with structure like the result of the [method lineinfo] method - but possibly with extra keys for truncation information if -show_truncated 1 is supplied
+[para]The truncation key in a lineinfo dict may be returned for first and/or last line in the resulting list.
+[para]truncation shows the shortened (missing bytes on left and/or right side) part of the entire line (potentially including line-ending or even partial line-ending)
+[para]Note that this truncation info is only in the return value of this method - and will not be reflected in [method lineinfo] queries to the main chunk.
+[call class::textinfo [method numeric_linerange] [arg startidx] [arg endidx]]
+[para]A helper to return any Tcl-style end end-x values given to startidx or endidx; converted to their specific values based on the current state of the underlying line data
+[para]This is used internally by API functions such as [method line] to enable it to accept more expressive indices
+[call class::textinfo [method numeric_chunkrange] [arg startidx] [arg endidx]]
+[para]A helper to return any Tcl-style end end-x entries supplied to startidx or endidx; converted to their specific values based on the current state of the underlying chunk data
+[call class::textinfo [method normalize_indices] [arg startidx] [arg endidx] [arg max]]
+[para]A utility to convert some of the of Tcl-style list-index expressions such as end, end-1 etc to valid indices in the range 0 to the supplied max
+[para]Basic addition and subtraction expressions such as 4-1 5+2 are accepted
+[para]startidx higher than endidx is allowed
+[para]Unlike Tcl's index expressions - we raise an error if the calculated index is out of bounds 0 to max
+[list_end]
+[list_end] [comment {--- end class enumeration ---}]
+[subsection {Namespace punk::fileline}]
+[para] Core API functions for punk::fileline
+[list_begin definitions]
+[list_end] [comment {--- end definitions namespace punk::fileline ---}]
+[subsection {Namespace punk::fileline::lib}]
+[para] Secondary functions that are part of the API
+[list_begin definitions]
+[call [fun lib::range_spans_chunk_boundaries] [arg start] [arg end] [arg chunksize]]
+[para]Takes start and end offset, generally representing bytes or character indices, and computes a list of boundaries at multiples of the chunksize that are spanned by the start and end range.
+[list_begin arguments]
+ [arg_def integer start]
+ [para] zero-based start index of range
+ [arg_def integer end]
+ [para] zero-based end index of range
+ [arg_def integer chunksize]
+ [para] Number of bytes/characters in chunk
+[list_end]
+[para]returns a dict with the keys is_span and boundaries
+[para]is_span 0|1 indicates if the range specified spans a boundary of chunksize
+[para]boundaries contains a list of the spanned boundaries - which are always multiples of the chunksize
+[para]e.g
+[example_begin]
+ range_spans_chunk_boundaries 10 1750 512
+ is_span 1 boundaries {512 1024 1536}
+[example_end]
+[para] This function automatically uses lseq (if Tcl >= 8.7) when number of boundaries spanned is approximately greater than 75
+[list_end] [comment {--- end definitions namespace punk::fileline::lib ---}]
+[section Internal]
+[subsection {Namespace punk::fileline::system}]
+[para] Internal functions that are not part of the API
+[manpage_end]
diff --git a/src/doc/punk/_module_path-0.1.0.tm.man b/src/doc/punk/_module_path-0.1.0.tm.man
index 9e448786..e9154899 100644
--- a/src/doc/punk/_module_path-0.1.0.tm.man
+++ b/src/doc/punk/_module_path-0.1.0.tm.man
@@ -46,8 +46,8 @@
[para] ie - the driveletter alone in paths such as c:/etc will still be case insensitive. (ie c:/ETC/* will match C:/ETC/blah but not C:/etc/blah)
[para] Explicitly specifying -nocase 0 will require the entire case to match including the driveletter.
[call [fun treefilenames] [arg basepath] [arg tailglob] [opt {option value...}]]
-basic (glob based) list of filenames matching tailglob - recursive
-no natsorting - so order is dependent on filesystem
+[para]basic (glob based) list of filenames matching tailglob - recursive
+[para]no natsorting - so order is dependent on filesystem
[call [fun relative] [arg reference] [arg location]]
[para] Taking two directory paths, a reference and a location, computes the path
of the location relative to the reference.
@@ -65,14 +65,30 @@ no natsorting - so order is dependent on filesystem
[item]
[para] Notes:
[para] Both paths must be the same type - ie both absolute or both relative
-[para] Case sensitive. ie relative /etc /etC
+[para] Case sensitive. ie punk::path::relative /etc /etC
will return ../etC
[para] On windows, the drive-letter component (only) is not case sensitive
-[para] ie relative c:/etc C:/etc returns .
-[para] but relative c:/etc C:/Etc returns ../Etc
+[example_begin]
+ P% punk::path::relative c:/etc C:/etc
+ - .
+[example_end]
+[para] The part following the driveletter is case sensitive so in the following cases it recognises the driveletter matches but not the tail
+[example_begin]
+ P% punk::path::relative c:/etc C:/Etc
+ - ../Etc
+[example_end]
[para] On windows, if the paths are absolute and specifiy different volumes, only the location will be returned.
- ie relative c:/etc d:/etc/blah
- returns d:/etc/blah
+[example_begin]
+ P% punk::path::relative c:/etc d:/etc/blah
+ - d:/etc/blah
+[example_end]
+[para] Unix-like examples:
+[example_begin]
+ P% punk::path::relative /usr/local/etc/ /usr/local/etc/somewhere/below
+ - somewhere/below
+ P% punk::path::relative /usr/local/etc/somewhere /usr/local/lib/here
+ - ../../lib/here
+[example_end]
[list_end]
[list_end] [comment {--- end definitions namespace punk::path ---}]
[subsection {Namespace punk::path::lib}]
diff --git a/src/embedded/man/files/punk/_module_fileline-0.1.0.tm.n b/src/embedded/man/files/punk/_module_fileline-0.1.0.tm.n
new file mode 100644
index 00000000..49fdd12d
--- /dev/null
+++ b/src/embedded/man/files/punk/_module_fileline-0.1.0.tm.n
@@ -0,0 +1,559 @@
+'\"
+'\" Generated from file '_module_fileline-0\&.1\&.0\&.tm\&.man' by tcllib/doctools with format 'nroff'
+'\" Copyright (c) 2024
+'\"
+.TH "punkshell_module_punk::fileline" 0 0\&.1\&.0 doc "punk fileline"
+.\" The -*- nroff -*- definitions below are for supplemental macros used
+.\" in Tcl/Tk manual entries.
+.\"
+.\" .AP type name in/out ?indent?
+.\" Start paragraph describing an argument to a library procedure.
+.\" type is type of argument (int, etc.), in/out is either "in", "out",
+.\" or "in/out" to describe whether procedure reads or modifies arg,
+.\" and indent is equivalent to second arg of .IP (shouldn't ever be
+.\" needed; use .AS below instead)
+.\"
+.\" .AS ?type? ?name?
+.\" Give maximum sizes of arguments for setting tab stops. Type and
+.\" name are examples of largest possible arguments that will be passed
+.\" to .AP later. If args are omitted, default tab stops are used.
+.\"
+.\" .BS
+.\" Start box enclosure. From here until next .BE, everything will be
+.\" enclosed in one large box.
+.\"
+.\" .BE
+.\" End of box enclosure.
+.\"
+.\" .CS
+.\" Begin code excerpt.
+.\"
+.\" .CE
+.\" End code excerpt.
+.\"
+.\" .VS ?version? ?br?
+.\" Begin vertical sidebar, for use in marking newly-changed parts
+.\" of man pages. The first argument is ignored and used for recording
+.\" the version when the .VS was added, so that the sidebars can be
+.\" found and removed when they reach a certain age. If another argument
+.\" is present, then a line break is forced before starting the sidebar.
+.\"
+.\" .VE
+.\" End of vertical sidebar.
+.\"
+.\" .DS
+.\" Begin an indented unfilled display.
+.\"
+.\" .DE
+.\" End of indented unfilled display.
+.\"
+.\" .SO ?manpage?
+.\" Start of list of standard options for a Tk widget. The manpage
+.\" argument defines where to look up the standard options; if
+.\" omitted, defaults to "options". The options follow on successive
+.\" lines, in three columns separated by tabs.
+.\"
+.\" .SE
+.\" End of list of standard options for a Tk widget.
+.\"
+.\" .OP cmdName dbName dbClass
+.\" Start of description of a specific option. cmdName gives the
+.\" option's name as specified in the class command, dbName gives
+.\" the option's name in the option database, and dbClass gives
+.\" the option's class in the option database.
+.\"
+.\" .UL arg1 arg2
+.\" Print arg1 underlined, then print arg2 normally.
+.\"
+.\" .QW arg1 ?arg2?
+.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
+.\"
+.\" .PQ arg1 ?arg2?
+.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
+.\" (for trailing punctuation) and then a closing parenthesis.
+.\"
+.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
+.if t .wh -1.3i ^B
+.nr ^l \n(.l
+.ad b
+.\" # Start an argument description
+.de AP
+.ie !"\\$4"" .TP \\$4
+.el \{\
+. ie !"\\$2"" .TP \\n()Cu
+. el .TP 15
+.\}
+.ta \\n()Au \\n()Bu
+.ie !"\\$3"" \{\
+\&\\$1 \\fI\\$2\\fP (\\$3)
+.\".b
+.\}
+.el \{\
+.br
+.ie !"\\$2"" \{\
+\&\\$1 \\fI\\$2\\fP
+.\}
+.el \{\
+\&\\fI\\$1\\fP
+.\}
+.\}
+..
+.\" # define tabbing values for .AP
+.de AS
+.nr )A 10n
+.if !"\\$1"" .nr )A \\w'\\$1'u+3n
+.nr )B \\n()Au+15n
+.\"
+.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
+.nr )C \\n()Bu+\\w'(in/out)'u+2n
+..
+.AS Tcl_Interp Tcl_CreateInterp in/out
+.\" # BS - start boxed text
+.\" # ^y = starting y location
+.\" # ^b = 1
+.de BS
+.br
+.mk ^y
+.nr ^b 1u
+.if n .nf
+.if n .ti 0
+.if n \l'\\n(.lu\(ul'
+.if n .fi
+..
+.\" # BE - end boxed text (draw box now)
+.de BE
+.nf
+.ti 0
+.mk ^t
+.ie n \l'\\n(^lu\(ul'
+.el \{\
+.\" Draw four-sided box normally, but don't draw top of
+.\" box if the box started on an earlier page.
+.ie !\\n(^b-1 \{\
+\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
+.\}
+.el \}\
+\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
+.\}
+.\}
+.fi
+.br
+.nr ^b 0
+..
+.\" # VS - start vertical sidebar
+.\" # ^Y = starting y location
+.\" # ^v = 1 (for troff; for nroff this doesn't matter)
+.de VS
+.if !"\\$2"" .br
+.mk ^Y
+.ie n 'mc \s12\(br\s0
+.el .nr ^v 1u
+..
+.\" # VE - end of vertical sidebar
+.de VE
+.ie n 'mc
+.el \{\
+.ev 2
+.nf
+.ti 0
+.mk ^t
+\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
+.sp -1
+.fi
+.ev
+.\}
+.nr ^v 0
+..
+.\" # Special macro to handle page bottom: finish off current
+.\" # box/sidebar if in box/sidebar mode, then invoked standard
+.\" # page bottom macro.
+.de ^B
+.ev 2
+'ti 0
+'nf
+.mk ^t
+.if \\n(^b \{\
+.\" Draw three-sided box if this is the box's first page,
+.\" draw two sides but no top otherwise.
+.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
+.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
+.\}
+.if \\n(^v \{\
+.nr ^x \\n(^tu+1v-\\n(^Yu
+\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
+.\}
+.bp
+'fi
+.ev
+.if \\n(^b \{\
+.mk ^y
+.nr ^b 2
+.\}
+.if \\n(^v \{\
+.mk ^Y
+.\}
+..
+.\" # DS - begin display
+.de DS
+.RS
+.nf
+.sp
+..
+.\" # DE - end display
+.de DE
+.fi
+.RE
+.sp
+..
+.\" # SO - start of list of standard options
+.de SO
+'ie '\\$1'' .ds So \\fBoptions\\fR
+'el .ds So \\fB\\$1\\fR
+.SH "STANDARD OPTIONS"
+.LP
+.nf
+.ta 5.5c 11c
+.ft B
+..
+.\" # SE - end of list of standard options
+.de SE
+.fi
+.ft R
+.LP
+See the \\*(So manual entry for details on the standard options.
+..
+.\" # OP - start of full description for a single option
+.de OP
+.LP
+.nf
+.ta 4c
+Command-Line Name: \\fB\\$1\\fR
+Database Name: \\fB\\$2\\fR
+Database Class: \\fB\\$3\\fR
+.fi
+.IP
+..
+.\" # CS - begin code excerpt
+.de CS
+.RS
+.nf
+.ta .25i .5i .75i 1i
+..
+.\" # CE - end code excerpt
+.de CE
+.fi
+.RE
+..
+.\" # UL - underline word
+.de UL
+\\$1\l'|0\(ul'\\$2
+..
+.\" # QW - apply quotation marks to word
+.de QW
+.ie '\\*(lq'"' ``\\$1''\\$2
+.\"" fix emacs highlighting
+.el \\*(lq\\$1\\*(rq\\$2
+..
+.\" # PQ - apply parens and quotation marks to word
+.de PQ
+.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
+.\"" fix emacs highlighting
+.el (\\*(lq\\$1\\*(rq\\$2)\\$3
+..
+.\" # QR - quoted range
+.de QR
+.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
+.\"" fix emacs highlighting
+.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
+..
+.\" # MT - "empty" string
+.de MT
+.QW ""
+..
+.BS
+.SH NAME
+punkshell_module_punk::fileline \- file line-handling utilities
+.SH SYNOPSIS
+package require \fBpunk::fileline \fR
+.sp
+class::textinfo \fBconstructor\fR \fIdatachunk\fR ?option value\&.\&.\&.?
+.sp
+class::textinfo \fBchunk\fR \fIchunkstart\fR \fIchunkend\fR
+.sp
+class::textinfo \fBchunklen\fR
+.sp
+class::textinfo \fBlinecount\fR
+.sp
+class::textinfo \fBregenerate_lines\fR
+.sp
+class::textinfo \fBline\fR \fIlineindex\fR
+.sp
+class::textinfo \fBlinepayload\fR \fIlineindex\fR
+.sp
+class::textinfo \fBlinemeta\fR \fIlineindex\fR
+.sp
+class::textinfo \fBlineinfo\fR \fIlineindex\fR
+.sp
+class::textinfo \fBlinerange_to_chunkrange\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBlinerange_to_chunk\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBlines\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBlinepayloads\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBchunkrange_to_linerange\fR \fIchunkstart\fR \fIchunkend\fR
+.sp
+class::textinfo \fBchunkrange_to_lineinfolist\fR \fIchunkstart\fR \fIchunkend\fR ?option value\&.\&.\&.?
+.sp
+class::textinfo \fBnumeric_linerange\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBnumeric_chunkrange\fR \fIstartidx\fR \fIendidx\fR
+.sp
+class::textinfo \fBnormalize_indices\fR \fIstartidx\fR \fIendidx\fR \fImax\fR
+.sp
+\fBlib::range_spans_chunk_boundaries\fR \fIstart\fR \fIend\fR \fIchunksize\fR
+.sp
+.BE
+.SH DESCRIPTION
+.PP
+-
+.SH OVERVIEW
+.PP
+Utilities for in-memory analysis of text file data as both line data and byte/char-counted data whilst preserving the line-endings (even if mixed)
+.PP
+This is important for certain text files where examining the number of chars/bytes is important
+.PP
+For example - windows \&.cmd/\&.bat files need some byte counting to determine if labels lie on chunk boundaries and need to be moved\&.
+.PP
+Despite including the word 'file', the library doesn't deal with reading/writing to the filesystem\&. It is for operating on text-file like data\&.
+.SS CONCEPTS
+.PP
+A chunk of textfile data (possibly representing a whole file - but usually at least a complete set of lines) is loaded into a punk::fileline::class::textinfo instance at object creation\&.
+.CS
+
+
+ package require punk::fileline
+ package require fileutil
+ set rawdata [fileutil::cat data\&.txt -translation binary]
+ punk::fileline::class::textinfo create obj_data $rawdata
+ puts stdout [obj_data linecount]
+
+.CE
+.SS NOTES
+.PP
+Line records are referred to by a zero-based index instead of a one-based index as is commonly used when displaying files\&.
+.PP
+This is for programming consistency and convenience, and the module user should do their own conversion to one-based indexing for line display or messaging if desired\&.
+.PP
+No support for lone carriage-returns being interpreted as line-endings\&.
+.PP
+CR line-endings that are intended to be interpreted as such should be mapped to something else before the data is supplied to this module\&.
+.SS DEPENDENCIES
+.PP
+packages used by punk::fileline
+.IP \(bu
+\fBTcl 8\&.6\fR
+.PP
+.SH API
+.SS "NAMESPACE PUNK::FILELINE::CLASS"
+.PP
+class definitions
+.IP [1]
+CLASS \fBtextinfo\fR
+.RS
+.sp
+\fIMETHODS\fR
+.TP
+class::textinfo \fBconstructor\fR \fIdatachunk\fR ?option value\&.\&.\&.?
+.sp
+Constructor for textinfo object which represents a chunk or all of a file
+.sp
+datachunk should be passed with the file data including line-endings as-is for full functionality\&. ie use something like:
+.CS
+
+
+ fconfigure $fd -translation binary
+ set chunkdata [read $fd]]
+or
+ set chunkdata [fileutil::cat -translation binary]
+
+.CE
+.sp
+when loading the data
+.TP
+class::textinfo \fBchunk\fR \fIchunkstart\fR \fIchunkend\fR
+.sp
+Return a range of bytes from the underlying raw chunk data\&.
+.sp
+e\&.g The following retrieves the entire chunk
+.sp
+objName chunk 0 end
+.TP
+class::textinfo \fBchunklen\fR
+.sp
+Number of bytes/characters in the raw data of the file
+.TP
+class::textinfo \fBlinecount\fR
+.sp
+Number of lines in the raw data of the file, counted as per the policy in effect
+.TP
+class::textinfo \fBregenerate_lines\fR
+.sp
+generate a list of lines from the stored raw data chunk and keep a map of line-endings indexed by lineindex
+.TP
+class::textinfo \fBline\fR \fIlineindex\fR
+.sp
+Reconstructs and returns the raw line using the payload and per-line stored line-ending metadata
+.sp
+A 'line' may be returned without a line-ending if the unerlying chunk had trailing data without a line-ending (or the chunk was loaded under a non-standard -policy setting)
+.sp
+Whilst such data may not conform to definitions (e\&.g POSIX) of the terms 'textfile' and 'line' - it is useful here to represent it as a line with metadata le set to "none"
+.sp
+To return just the data which might more commonly be needed for dealing with lines, use the \fBlinepayload\fR method - which returns the line data minus line-ending
+.TP
+class::textinfo \fBlinepayload\fR \fIlineindex\fR
+.sp
+Return the text of the line indicated by the zero-based lineindex
+.sp
+The line-ending is not returned in the data - but is still stored against this lineindex
+.sp
+Line Metadata such as the line-ending for a particular line and the byte/character range it occupies within the chunk can be retrieved with the \fBlinemeta\fR method
+.sp
+To retrieve both the line text and metadata in a single call the \fBlineinfo\fR method can be used
+.sp
+To retrieve an entire line including line-ending use the \fBline\fR method\&.
+.TP
+class::textinfo \fBlinemeta\fR \fIlineindex\fR
+.sp
+Return a dict of the metadata for the line indicated by the zero-based lineindex
+.sp
+Keys returned include
+.RS
+.IP \(bu
+le
+.sp
+A string representing the type of line-ending: crlf|lf|none
+.IP \(bu
+linelen
+.sp
+The number of characters/bytes in the whole line including line-ending if any
+.IP \(bu
+payloadlen
+.sp
+The number of character/bytes in the line excluding line-ending
+.IP \(bu
+start
+.sp
+The zero-based index into the associated raw file data indicating at which byte/character index this line begins
+.IP \(bu
+end
+.sp
+The zero-based index into the associated raw file data indicating at which byte/character index this line ends
+.sp
+This end-point corresponds to the last character of the line-ending if any - not necessarily the last character of the line's payload
+.RE
+.TP
+class::textinfo \fBlineinfo\fR \fIlineindex\fR
+.sp
+Return a dict of the metadata and text for the line indicated by the zero-based lineindex
+.sp
+This returns the same info as the \fBlinemeta\fR with an added key of 'payload' which is the text of the line without line-ending\&.
+.sp
+The 'payload' value is the same as is returned from the \fBlinepayload\fR method\&.
+.TP
+class::textinfo \fBlinerange_to_chunkrange\fR \fIstartidx\fR \fIendidx\fR
+.TP
+class::textinfo \fBlinerange_to_chunk\fR \fIstartidx\fR \fIendidx\fR
+.TP
+class::textinfo \fBlines\fR \fIstartidx\fR \fIendidx\fR
+.TP
+class::textinfo \fBlinepayloads\fR \fIstartidx\fR \fIendidx\fR
+.TP
+class::textinfo \fBchunkrange_to_linerange\fR \fIchunkstart\fR \fIchunkend\fR
+.TP
+class::textinfo \fBchunkrange_to_lineinfolist\fR \fIchunkstart\fR \fIchunkend\fR ?option value\&.\&.\&.?
+.sp
+Return a list of dicts each with structure like the result of the \fBlineinfo\fR method - but possibly with extra keys for truncation information if -show_truncated 1 is supplied
+.sp
+The truncation key in a lineinfo dict may be returned for first and/or last line in the resulting list\&.
+.sp
+truncation shows the shortened (missing bytes on left and/or right side) part of the entire line (potentially including line-ending or even partial line-ending)
+.sp
+Note that this truncation info is only in the return value of this method - and will not be reflected in \fBlineinfo\fR queries to the main chunk\&.
+.TP
+class::textinfo \fBnumeric_linerange\fR \fIstartidx\fR \fIendidx\fR
+.sp
+A helper to return any Tcl-style end end-x values given to startidx or endidx; converted to their specific values based on the current state of the underlying line data
+.sp
+This is used internally by API functions such as \fBline\fR to enable it to accept more expressive indices
+.TP
+class::textinfo \fBnumeric_chunkrange\fR \fIstartidx\fR \fIendidx\fR
+.sp
+A helper to return any Tcl-style end end-x entries supplied to startidx or endidx; converted to their specific values based on the current state of the underlying chunk data
+.TP
+class::textinfo \fBnormalize_indices\fR \fIstartidx\fR \fIendidx\fR \fImax\fR
+.sp
+A utility to convert some of the of Tcl-style list-index expressions such as end, end-1 etc to valid indices in the range 0 to the supplied max
+.sp
+Basic addition and subtraction expressions such as 4-1 5+2 are accepted
+.sp
+startidx higher than endidx is allowed
+.sp
+Unlike Tcl's index expressions - we raise an error if the calculated index is out of bounds 0 to max
+.RE
+.PP
+.SS "NAMESPACE PUNK::FILELINE"
+.PP
+Core API functions for punk::fileline
+.PP
+.SS "NAMESPACE PUNK::FILELINE::LIB"
+.PP
+Secondary functions that are part of the API
+.TP
+\fBlib::range_spans_chunk_boundaries\fR \fIstart\fR \fIend\fR \fIchunksize\fR
+.sp
+Takes start and end offset, generally representing bytes or character indices, and computes a list of boundaries at multiples of the chunksize that are spanned by the start and end range\&.
+.RS
+.TP
+integer \fIstart\fR
+.sp
+zero-based start index of range
+.TP
+integer \fIend\fR
+.sp
+zero-based end index of range
+.TP
+integer \fIchunksize\fR
+.sp
+Number of bytes/characters in chunk
+.RE
+.sp
+returns a dict with the keys is_span and boundaries
+.sp
+is_span 0|1 indicates if the range specified spans a boundary of chunksize
+.sp
+boundaries contains a list of the spanned boundaries - which are always multiples of the chunksize
+.sp
+e\&.g
+.CS
+
+
+ range_spans_chunk_boundaries 10 1750 512
+ is_span 1 boundaries {512 1024 1536}
+
+.CE
+.sp
+This function automatically uses lseq (if Tcl >= 8\&.7) when number of boundaries spanned is approximately greater than 75
+.PP
+.SH INTERNAL
+.SS "NAMESPACE PUNK::FILELINE::SYSTEM"
+.PP
+Internal functions that are not part of the API
+.SH KEYWORDS
+file, module, parse, text
+.SH COPYRIGHT
+.nf
+Copyright (c) 2024
+
+.fi
diff --git a/src/embedded/man/files/punk/_module_path-0.1.0.tm.n b/src/embedded/man/files/punk/_module_path-0.1.0.tm.n
index c8a5ff72..a5be8569 100644
--- a/src/embedded/man/files/punk/_module_path-0.1.0.tm.n
+++ b/src/embedded/man/files/punk/_module_path-0.1.0.tm.n
@@ -347,7 +347,9 @@ ie - the driveletter alone in paths such as c:/etc will still be case insensitiv
Explicitly specifying -nocase 0 will require the entire case to match including the driveletter\&.
.TP
\fBtreefilenames\fR \fIbasepath\fR \fItailglob\fR ?option value\&.\&.\&.?
+.sp
basic (glob based) list of filenames matching tailglob - recursive
+.sp
no natsorting - so order is dependent on filesystem
.TP
\fBrelative\fR \fIreference\fR \fIlocation\fR
@@ -379,18 +381,46 @@ Notes:
.sp
Both paths must be the same type - ie both absolute or both relative
.sp
-Case sensitive\&. ie relative /etc /etC
+Case sensitive\&. ie punk::path::relative /etc /etC
will return \&.\&./etC
.sp
On windows, the drive-letter component (only) is not case sensitive
+.CS
+
+
+ P% punk::path::relative c:/etc C:/etc
+ - \&.
+
+.CE
.sp
-ie relative c:/etc C:/etc returns \&.
-.sp
-but relative c:/etc C:/Etc returns \&.\&./Etc
+The part following the driveletter is case sensitive so in the following cases it recognises the driveletter matches but not the tail
+.CS
+
+
+ P% punk::path::relative c:/etc C:/Etc
+ - \&.\&./Etc
+
+.CE
.sp
On windows, if the paths are absolute and specifiy different volumes, only the location will be returned\&.
-ie relative c:/etc d:/etc/blah
-returns d:/etc/blah
+.CS
+
+
+ P% punk::path::relative c:/etc d:/etc/blah
+ - d:/etc/blah
+
+.CE
+.sp
+Unix-like examples:
+.CS
+
+
+ P% punk::path::relative /usr/local/etc/ /usr/local/etc/somewhere/below
+ - somewhere/below
+ P% punk::path::relative /usr/local/etc/somewhere /usr/local/lib/here
+ - \&.\&./\&.\&./lib/here
+
+.CE
.RE
.PP
.SS "NAMESPACE PUNK::PATH::LIB"
diff --git a/src/embedded/man/index.n b/src/embedded/man/index.n
index 80c874e9..41f44d9a 100644
--- a/src/embedded/man/index.n
+++ b/src/embedded/man/index.n
@@ -284,6 +284,12 @@ changelog
\fBfiles/project_changes\&.n\fR
punkshell__project_changes
.RE
+file
+.RS
+.TP
+\fBfiles/punk/_module_fileline-0\&.1\&.0\&.tm\&.n\fR
+punkshell_module_punk::fileline
+.RE
filesystem
.RS
.TP
@@ -296,9 +302,18 @@ module
\fBfiles/punk/_module_cap-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::cap
.TP
+\fBfiles/punk/_module_fileline-0\&.1\&.0\&.tm\&.n\fR
+punkshell_module_punk::fileline
+.TP
\fBfiles/punk/_module_path-0\&.1\&.0\&.tm\&.n\fR
punkshell_module_punk::path
.RE
+parse
+.RS
+.TP
+\fBfiles/punk/_module_fileline-0\&.1\&.0\&.tm\&.n\fR
+punkshell_module_punk::fileline
+.RE
path
.RS
.TP
@@ -347,4 +362,10 @@ punkshell__project_changes
\fBfiles/project_intro\&.n\fR
punkshell__project_intro
.RE
+text
+.RS
+.TP
+\fBfiles/punk/_module_fileline-0\&.1\&.0\&.tm\&.n\fR
+punkshell_module_punk::fileline
+.RE
.RE
diff --git a/src/embedded/man/toc.n b/src/embedded/man/toc.n
index f459e74d..1ec27a2d 100644
--- a/src/embedded/man/toc.n
+++ b/src/embedded/man/toc.n
@@ -285,6 +285,9 @@ doc
\fBpunkshell_module_punk::cap\fR
\fIfiles/punk/_module_cap-0\&.1\&.0\&.tm\&.n\fR: capability provider and handler plugin system
.TP
+\fBpunkshell_module_punk::fileline\fR
+\fIfiles/punk/_module_fileline-0\&.1\&.0\&.tm\&.n\fR: file line-handling utilities
+.TP
\fBpunkshell_module_punk::mix::commandset::project\fR
\fIfiles/punk/mix/commandset/_module_project-0\&.1\&.0\&.tm\&.n\fR: pmix commandset - project
.TP
diff --git a/src/embedded/md/.doc/tocdoc b/src/embedded/md/.doc/tocdoc
index e3cd5c57..1e536399 100644
--- a/src/embedded/md/.doc/tocdoc
+++ b/src/embedded/md/.doc/tocdoc
@@ -3,6 +3,7 @@
[item doc/files/project_changes.md punkshell__project_changes {punkshell Changes}]
[item doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}]
[item doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}]
+[item doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}]
[item doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {pmix commandset - project}]
[item doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}]
[toc_end]
diff --git a/src/embedded/md/.idx b/src/embedded/md/.idx
index 6186d3ff..c892561d 100644
--- a/src/embedded/md/.idx
+++ b/src/embedded/md/.idx
@@ -1 +1 @@
-{shell {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}} changelog {{doc/files/project_changes.md punkshell__project_changes}} filesystem {{doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} path {{doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} capability {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap}} module {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} punk {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}} plugin {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap}} repl {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}}} {{changelog doc/files/project_changes.md punkshell__project_changes} . {shell doc/files/project_changes.md punkshell__project_changes} . {shell doc/files/main.md punkshell} . {repl doc/files/project_intro.md punkshell__project_intro} . {module doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} . {plugin doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} . {filesystem doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {path doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {module doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {shell doc/files/project_intro.md punkshell__project_intro} . {punk doc/files/project_changes.md punkshell__project_changes} . {punk doc/files/main.md punkshell} . {repl doc/files/project_changes.md punkshell__project_changes} . {punk doc/files/project_intro.md punkshell__project_intro} . {repl doc/files/main.md punkshell} . {capability doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} .} 9 {shell shell changelog changelog filesystem filesystem path path capability capability module module punk punk plugin plugin repl repl}
\ No newline at end of file
+{file {{doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline}} repl {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}} text {{doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline}} shell {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}} changelog {{doc/files/project_changes.md punkshell__project_changes}} capability {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap}} parse {{doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline}} filesystem {{doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} path {{doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} module {{doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline} {doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path}} punk {{doc/files/project_intro.md punkshell__project_intro} {doc/files/project_changes.md punkshell__project_changes} {doc/files/main.md punkshell}} plugin {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap}}} {{shell doc/files/project_changes.md punkshell__project_changes} . {changelog doc/files/project_changes.md punkshell__project_changes} . {shell doc/files/main.md punkshell} . {text doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline} . {repl doc/files/project_intro.md punkshell__project_intro} . {module doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} . {plugin doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} . {filesystem doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {path doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {module doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path} . {punk doc/files/project_changes.md punkshell__project_changes} . {shell doc/files/project_intro.md punkshell__project_intro} . {parse doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline} . {punk doc/files/main.md punkshell} . {module doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline} . {repl doc/files/project_changes.md punkshell__project_changes} . {punk doc/files/project_intro.md punkshell__project_intro} . {file doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline} . {repl doc/files/main.md punkshell} . {capability doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap} .} 12 {file file repl repl text text shell shell changelog changelog capability capability parse parse filesystem filesystem path path module module punk punk plugin plugin}
\ No newline at end of file
diff --git a/src/embedded/md/.toc b/src/embedded/md/.toc
index 7c55cb42..18e4bf21 100644
--- a/src/embedded/md/.toc
+++ b/src/embedded/md/.toc
@@ -1 +1 @@
-doc {doc/toc {{doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}} {doc/files/project_changes.md punkshell__project_changes {punkshell Changes}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {pmix commandset - project}} {doc/files/main.md punkshell {punkshell - Core}}}}
\ No newline at end of file
+doc {doc/toc {{doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_cap-0.1.0.tm.md punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/project_intro.md punkshell__project_intro {Introduction to punkshell}} {doc/files/punk/_module_path-0.1.0.tm.md punkshell_module_punk::path {Filesystem path utilities}} {doc/files/project_changes.md punkshell__project_changes {punkshell Changes}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md punkshell_module_punk::mix::commandset::project {pmix commandset - project}} {doc/files/main.md punkshell {punkshell - Core}}}}
\ No newline at end of file
diff --git a/src/embedded/md/.xrf b/src/embedded/md/.xrf
index ee6b22ac..5dc9fb66 100644
--- a/src/embedded/md/.xrf
+++ b/src/embedded/md/.xrf
@@ -1 +1 @@
-kw,capability {index.md capability} punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.md sa,punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {punkshell Changes} doc/files/project_changes.md {Introduction to punkshell} doc/files/project_intro.md punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md sa,punkshell(n) doc/files/main.md filesystem {index.md filesystem} sa,punkshell doc/files/main.md kw,shell {index.md shell} sa,punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.md sa,punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.md sa,punkshell__project_changes(n) doc/files/project_changes.md kw,path {index.md path} kw,module {index.md module} punkshell(n) doc/files/main.md kw,plugin {index.md plugin} punkshell doc/files/main.md punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.md changelog {index.md changelog} punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.md punkshell__project_changes(n) doc/files/project_changes.md sa,punkshell__project_changes doc/files/project_changes.md path {index.md path} sa,punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.md punkshell__project_changes doc/files/project_changes.md kw,filesystem {index.md filesystem} sa,punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md shell {index.md shell} punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.md kw,repl {index.md repl} capability {index.md capability} punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {punkshell - Core} doc/files/main.md {pmix commandset - project} doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {capability provider and handler plugin system} doc/files/punk/_module_cap-0.1.0.tm.md repl {index.md repl} kw,punk {index.md punk} sa,punkshell__project_intro(n) doc/files/project_intro.md sa,punkshell__project_intro doc/files/project_intro.md {Filesystem path utilities} doc/files/punk/_module_path-0.1.0.tm.md sa,punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.md punkshell__project_intro(n) doc/files/project_intro.md punkshell__project_intro doc/files/project_intro.md kw,changelog {index.md changelog} punk {index.md punk} module {index.md module} plugin {index.md plugin}
\ No newline at end of file
+kw,capability {index.md capability} punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.md sa,punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {punkshell Changes} doc/files/project_changes.md {Introduction to punkshell} doc/files/project_intro.md sa,punkshell_module_punk::fileline(0) doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md sa,punkshell(n) doc/files/main.md filesystem {index.md filesystem} sa,punkshell doc/files/main.md kw,shell {index.md shell} sa,punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.md sa,punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.md kw,parse {index.md parse} sa,punkshell__project_changes(n) doc/files/project_changes.md kw,path {index.md path} kw,module {index.md module} punkshell_module_punk::fileline(0) doc/files/punk/_module_fileline-0.1.0.tm.md punkshell(n) doc/files/main.md kw,plugin {index.md plugin} punkshell doc/files/main.md kw,file {index.md file} punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.md changelog {index.md changelog} punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.md punkshell__project_changes(n) doc/files/project_changes.md sa,punkshell__project_changes doc/files/project_changes.md path {index.md path} file {index.md file} sa,punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.md punkshell__project_changes doc/files/project_changes.md kw,filesystem {index.md filesystem} sa,punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md shell {index.md shell} punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.md kw,repl {index.md repl} capability {index.md capability} kw,text {index.md text} parse {index.md parse} sa,punkshell_module_punk::fileline doc/files/punk/_module_fileline-0.1.0.tm.md punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {punkshell - Core} doc/files/main.md {pmix commandset - project} doc/files/punk/mix/commandset/_module_project-0.1.0.tm.md {capability provider and handler plugin system} doc/files/punk/_module_cap-0.1.0.tm.md repl {index.md repl} punkshell_module_punk::fileline doc/files/punk/_module_fileline-0.1.0.tm.md kw,punk {index.md punk} sa,punkshell__project_intro(n) doc/files/project_intro.md text {index.md text} sa,punkshell__project_intro doc/files/project_intro.md {Filesystem path utilities} doc/files/punk/_module_path-0.1.0.tm.md sa,punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.md punkshell__project_intro(n) doc/files/project_intro.md {file line-handling utilities} doc/files/punk/_module_fileline-0.1.0.tm.md punkshell__project_intro doc/files/project_intro.md kw,changelog {index.md changelog} module {index.md module} punk {index.md punk} plugin {index.md plugin}
\ No newline at end of file
diff --git a/src/embedded/md/doc/files/punk/_module_fileline-0.1.0.tm.md b/src/embedded/md/doc/files/punk/_module_fileline-0.1.0.tm.md
new file mode 100644
index 00000000..9ed788e3
--- /dev/null
+++ b/src/embedded/md/doc/files/punk/_module_fileline-0.1.0.tm.md
@@ -0,0 +1,353 @@
+
+[//000000001]: # (punkshell\_module\_punk::fileline \- punk fileline)
+[//000000002]: # (Generated from file '\_module\_fileline\-0\.1\.0\.tm\.man' by tcllib/doctools with format 'markdown')
+[//000000003]: # (Copyright © 2024)
+[//000000004]: # (punkshell\_module\_punk::fileline\(0\) 0\.1\.0 doc "punk fileline")
+
+
[ Main Table Of Contents | Table Of Contents | Keyword Index ]
+
+# NAME
+
+punkshell\_module\_punk::fileline \- file line\-handling utilities
+
+# Table Of Contents
+
+ - [Table Of Contents](#toc)
+
+ - [Synopsis](#synopsis)
+
+ - [Description](#section1)
+
+ - [Overview](#section2)
+
+ - [Concepts](#subsection1)
+
+ - [Notes](#subsection2)
+
+ - [dependencies](#subsection3)
+
+ - [API](#section3)
+
+ - [Namespace punk::fileline::class](#subsection4)
+
+ - [Namespace punk::fileline](#subsection5)
+
+ - [Namespace punk::fileline::lib](#subsection6)
+
+ - [Internal](#section4)
+
+ - [Namespace punk::fileline::system](#subsection7)
+
+ - [Keywords](#keywords)
+
+ - [Copyright](#copyright)
+
+# SYNOPSIS
+
+package require punk::fileline
+
+[class::textinfo __constructor__ *datachunk* ?option value\.\.\.?](#1)
+[class::textinfo __chunk__ *chunkstart* *chunkend*](#2)
+[class::textinfo __chunklen__](#3)
+[class::textinfo __linecount__](#4)
+[class::textinfo __regenerate\_lines__](#5)
+[class::textinfo __line__ *lineindex*](#6)
+[class::textinfo __linepayload__ *lineindex*](#7)
+[class::textinfo __linemeta__ *lineindex*](#8)
+[class::textinfo __lineinfo__ *lineindex*](#9)
+[class::textinfo __linerange\_to\_chunkrange__ *startidx* *endidx*](#10)
+[class::textinfo __linerange\_to\_chunk__ *startidx* *endidx*](#11)
+[class::textinfo __lines__ *startidx* *endidx*](#12)
+[class::textinfo __linepayloads__ *startidx* *endidx*](#13)
+[class::textinfo __chunkrange\_to\_linerange__ *chunkstart* *chunkend*](#14)
+[class::textinfo __chunkrange\_to\_lineinfolist__ *chunkstart* *chunkend* ?option value\.\.\.?](#15)
+[class::textinfo __numeric\_linerange__ *startidx* *endidx*](#16)
+[class::textinfo __numeric\_chunkrange__ *startidx* *endidx*](#17)
+[class::textinfo __normalize\_indices__ *startidx* *endidx* *max*](#18)
+[__lib::range\_spans\_chunk\_boundaries__ *start* *end* *chunksize*](#19)
+
+# DESCRIPTION
+
+\-
+
+# Overview
+
+Utilities for in\-memory analysis of text file data as both line data and
+byte/char\-counted data whilst preserving the line\-endings \(even if mixed\)
+
+This is important for certain text files where examining the number of
+chars/bytes is important
+
+For example \- windows \.cmd/\.bat files need some byte counting to determine if
+labels lie on chunk boundaries and need to be moved\.
+
+Despite including the word 'file', the library doesn't deal with reading/writing
+to the filesystem\. It is for operating on text\-file like data\.
+
+## Concepts
+
+A chunk of textfile data \(possibly representing a whole file \- but usually at
+least a complete set of lines\) is loaded into a punk::fileline::class::textinfo
+instance at object creation\.
+
+ package require punk::fileline
+ package require fileutil
+ set rawdata [fileutil::cat data.txt -translation binary]
+ punk::fileline::class::textinfo create obj_data $rawdata
+ puts stdout [obj_data linecount]
+
+## Notes
+
+Line records are referred to by a zero\-based index instead of a one\-based index
+as is commonly used when displaying files\.
+
+This is for programming consistency and convenience, and the module user should
+do their own conversion to one\-based indexing for line display or messaging if
+desired\.
+
+No support for lone carriage\-returns being interpreted as line\-endings\.
+
+CR line\-endings that are intended to be interpreted as such should be mapped to
+something else before the data is supplied to this module\.
+
+## dependencies
+
+packages used by punk::fileline
+
+ - __Tcl 8\.6__
+
+# API
+
+## Namespace punk::fileline::class
+
+class definitions
+
+ 1. CLASS __textinfo__
+
+ - class::textinfo __constructor__ *datachunk* ?option value\.\.\.?
+
+ *METHODS*
+
+ Constructor for textinfo object which represents a chunk or all of a
+ file
+
+ datachunk should be passed with the file data including line\-endings
+ as\-is for full functionality\. ie use something like:
+
+ fconfigure $fd -translation binary
+ set chunkdata [read $fd]]
+ or
+ set chunkdata [fileutil::cat -translation binary]
+
+ when loading the data
+
+ - class::textinfo __chunk__ *chunkstart* *chunkend*
+
+ Return a range of bytes from the underlying raw chunk data\.
+
+ e\.g The following retrieves the entire chunk
+
+ objName chunk 0 end
+
+ - class::textinfo __chunklen__
+
+ Number of bytes/characters in the raw data of the file
+
+ - class::textinfo __linecount__
+
+ Number of lines in the raw data of the file, counted as per the policy
+ in effect
+
+ - class::textinfo __regenerate\_lines__
+
+ generate a list of lines from the stored raw data chunk and keep a map
+ of line\-endings indexed by lineindex
+
+ - class::textinfo __line__ *lineindex*
+
+ Reconstructs and returns the raw line using the payload and per\-line
+ stored line\-ending metadata
+
+ A 'line' may be returned without a line\-ending if the unerlying chunk
+ had trailing data without a line\-ending \(or the chunk was loaded under
+ a non\-standard \-policy setting\)
+
+ Whilst such data may not conform to definitions \(e\.g POSIX\) of the
+ terms 'textfile' and 'line' \- it is useful here to represent it as a
+ line with metadata le set to "none"
+
+ To return just the data which might more commonly be needed for dealing
+ with lines, use the __linepayload__ method \- which returns the line
+ data minus line\-ending
+
+ - class::textinfo __linepayload__ *lineindex*
+
+ Return the text of the line indicated by the zero\-based lineindex
+
+ The line\-ending is not returned in the data \- but is still stored
+ against this lineindex
+
+ Line Metadata such as the line\-ending for a particular line and the
+ byte/character range it occupies within the chunk can be retrieved with
+ the __linemeta__ method
+
+ To retrieve both the line text and metadata in a single call the
+ __lineinfo__ method can be used
+
+ To retrieve an entire line including line\-ending use the __line__
+ method\.
+
+ - class::textinfo __linemeta__ *lineindex*
+
+ Return a dict of the metadata for the line indicated by the zero\-based
+ lineindex
+
+ Keys returned include
+
+ * le
+
+ A string representing the type of line\-ending: crlf|lf|none
+
+ * linelen
+
+ The number of characters/bytes in the whole line including
+ line\-ending if any
+
+ * payloadlen
+
+ The number of character/bytes in the line excluding line\-ending
+
+ * start
+
+ The zero\-based index into the associated raw file data indicating
+ at which byte/character index this line begins
+
+ * end
+
+ The zero\-based index into the associated raw file data indicating
+ at which byte/character index this line ends
+
+ This end\-point corresponds to the last character of the line\-ending
+ if any \- not necessarily the last character of the line's payload
+
+ - class::textinfo __lineinfo__ *lineindex*
+
+ Return a dict of the metadata and text for the line indicated by the
+ zero\-based lineindex
+
+ This returns the same info as the __linemeta__ with an added key of
+ 'payload' which is the text of the line without line\-ending\.
+
+ The 'payload' value is the same as is returned from the
+ __linepayload__ method\.
+
+ - class::textinfo __linerange\_to\_chunkrange__ *startidx* *endidx*
+
+ - class::textinfo __linerange\_to\_chunk__ *startidx* *endidx*
+
+ - class::textinfo __lines__ *startidx* *endidx*
+
+ - class::textinfo __linepayloads__ *startidx* *endidx*
+
+ - class::textinfo __chunkrange\_to\_linerange__ *chunkstart* *chunkend*
+
+ - class::textinfo __chunkrange\_to\_lineinfolist__ *chunkstart* *chunkend* ?option value\.\.\.?
+
+ Return a list of dicts each with structure like the result of the
+ __lineinfo__ method \- but possibly with extra keys for truncation
+ information if \-show\_truncated 1 is supplied
+
+ The truncation key in a lineinfo dict may be returned for first and/or
+ last line in the resulting list\.
+
+ truncation shows the shortened \(missing bytes on left and/or right
+ side\) part of the entire line \(potentially including line\-ending or
+ even partial line\-ending\)
+
+ Note that this truncation info is only in the return value of this
+ method \- and will not be reflected in __lineinfo__ queries to the
+ main chunk\.
+
+ - class::textinfo __numeric\_linerange__ *startidx* *endidx*
+
+ A helper to return any Tcl\-style end end\-x values given to startidx or
+ endidx; converted to their specific values based on the current state
+ of the underlying line data
+
+ This is used internally by API functions such as __line__ to enable
+ it to accept more expressive indices
+
+ - class::textinfo __numeric\_chunkrange__ *startidx* *endidx*
+
+ A helper to return any Tcl\-style end end\-x entries supplied to startidx
+ or endidx; converted to their specific values based on the current
+ state of the underlying chunk data
+
+ - class::textinfo __normalize\_indices__ *startidx* *endidx* *max*
+
+ A utility to convert some of the of Tcl\-style list\-index expressions
+ such as end, end\-1 etc to valid indices in the range 0 to the supplied
+ max
+
+ Basic addition and subtraction expressions such as 4\-1 5\+2 are accepted
+
+ startidx higher than endidx is allowed
+
+ Unlike Tcl's index expressions \- we raise an error if the calculated
+ index is out of bounds 0 to max
+
+## Namespace punk::fileline
+
+Core API functions for punk::fileline
+
+## Namespace punk::fileline::lib
+
+ - __lib::range\_spans\_chunk\_boundaries__ *start* *end* *chunksize*
+
+ Takes start and end offset, generally representing bytes or character
+ indices, and computes a list of boundaries at multiples of the chunksize
+ that are spanned by the start and end range\.
+
+ * integer *start*
+
+ zero\-based start index of range
+
+ * integer *end*
+
+ zero\-based end index of range
+
+ * integer *chunksize*
+
+ Number of bytes/characters in chunk
+
+ returns a dict with the keys is\_span and boundaries
+
+ is\_span 0|1 indicates if the range specified spans a boundary of chunksize
+
+ boundaries contains a list of the spanned boundaries \- which are always
+ multiples of the chunksize
+
+ e\.g
+
+ range_spans_chunk_boundaries 10 1750 512
+ is_span 1 boundaries {512 1024 1536}
+
+ This function automatically uses lseq \(if Tcl >= 8\.7\) when number of
+ boundaries spanned is approximately greater than 75
+
+# Internal
+
+## Namespace punk::fileline::system
+
+Internal functions that are not part of the API
+
+# KEYWORDS
+
+[file](\.\./\.\./\.\./index\.md\#file), [module](\.\./\.\./\.\./index\.md\#module),
+[parse](\.\./\.\./\.\./index\.md\#parse), [text](\.\./\.\./\.\./index\.md\#text)
+
+# COPYRIGHT
+
+Copyright © 2024
diff --git a/src/embedded/md/doc/files/punk/_module_path-0.1.0.tm.md b/src/embedded/md/doc/files/punk/_module_path-0.1.0.tm.md
index 9192184b..3a9398a6 100644
--- a/src/embedded/md/doc/files/punk/_module_path-0.1.0.tm.md
+++ b/src/embedded/md/doc/files/punk/_module_path-0.1.0.tm.md
@@ -125,8 +125,9 @@ class definitions
- __treefilenames__ *basepath* *tailglob* ?option value\.\.\.?
- basic \(glob based\) list of filenames matching tailglob \- recursive no
- natsorting \- so order is dependent on filesystem
+ basic \(glob based\) list of filenames matching tailglob \- recursive
+
+ no natsorting \- so order is dependent on filesystem
- __relative__ *reference* *location*
@@ -153,17 +154,31 @@ class definitions
Both paths must be the same type \- ie both absolute or both relative
- Case sensitive\. ie relative /etc /etC will return \.\./etC
+ Case sensitive\. ie punk::path::relative /etc /etC will return \.\./etC
On windows, the drive\-letter component \(only\) is not case sensitive
- ie relative c:/etc C:/etc returns \.
+ P% punk::path::relative c:/etc C:/etc
+ - .
+
+ The part following the driveletter is case sensitive so in the following
+ cases it recognises the driveletter matches but not the tail
- but relative c:/etc C:/Etc returns \.\./Etc
+ P% punk::path::relative c:/etc C:/Etc
+ - ../Etc
On windows, if the paths are absolute and specifiy different volumes,
- only the location will be returned\. ie relative c:/etc d:/etc/blah
- returns d:/etc/blah
+ only the location will be returned\.
+
+ P% punk::path::relative c:/etc d:/etc/blah
+ - d:/etc/blah
+
+ Unix\-like examples:
+
+ P% punk::path::relative /usr/local/etc/ /usr/local/etc/somewhere/below
+ - somewhere/below
+ P% punk::path::relative /usr/local/etc/somewhere /usr/local/lib/here
+ - ../../lib/here
## Namespace punk::path::lib
diff --git a/src/embedded/md/doc/toc.md b/src/embedded/md/doc/toc.md
index fd79bcd6..63ab3c56 100644
--- a/src/embedded/md/doc/toc.md
+++ b/src/embedded/md/doc/toc.md
@@ -11,6 +11,8 @@
- [punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) capability provider and handler plugin system
+ - [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) file line\-handling utilities
+
- [punkshell\_module\_punk::mix::commandset::project](doc/files/punk/mix/commandset/\_module\_project\-0\.1\.0\.tm\.md) pmix commandset \- project
- [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) Filesystem path utilities
diff --git a/src/embedded/md/index.md b/src/embedded/md/index.md
index 69146770..591eff4c 100644
--- a/src/embedded/md/index.md
+++ b/src/embedded/md/index.md
@@ -5,7 +5,7 @@
----
-[C](#cC) · [F](#cF) · [M](#cM) · [P](#cP) · [R](#cR) · [S](#cS)
+[C](#cC) · [F](#cF) · [M](#cM) · [P](#cP) · [R](#cR) · [S](#cS) · [T](#cT)
----
@@ -21,6 +21,7 @@
|||
|---|---|
+|file|[punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md)|
|filesystem|[punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md)|
@@ -28,13 +29,14 @@
|||
|---|---|
-|module|[punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) · [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md)|
+|module|[punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) · [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) · [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md)|
#### Keywords: P
|||
|---|---|
+|parse|[punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md)|
|path|[punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md)|
|plugin|[punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md)|
|punk|[punkshell](doc/files/main\.md) · [punkshell\_\_project\_changes](doc/files/project\_changes\.md) · [punkshell\_\_project\_intro](doc/files/project\_intro\.md)|
@@ -52,3 +54,10 @@
|||
|---|---|
|shell|[punkshell](doc/files/main\.md) · [punkshell\_\_project\_changes](doc/files/project\_changes\.md) · [punkshell\_\_project\_intro](doc/files/project\_intro\.md)|
+
+
+#### Keywords: T
+
+|||
+|---|---|
+|text|[punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md)|
diff --git a/src/embedded/md/toc.md b/src/embedded/md/toc.md
index fd79bcd6..63ab3c56 100644
--- a/src/embedded/md/toc.md
+++ b/src/embedded/md/toc.md
@@ -11,6 +11,8 @@
- [punkshell\_module\_punk::cap](doc/files/punk/\_module\_cap\-0\.1\.0\.tm\.md) capability provider and handler plugin system
+ - [punkshell\_module\_punk::fileline](doc/files/punk/\_module\_fileline\-0\.1\.0\.tm\.md) file line\-handling utilities
+
- [punkshell\_module\_punk::mix::commandset::project](doc/files/punk/mix/commandset/\_module\_project\-0\.1\.0\.tm\.md) pmix commandset \- project
- [punkshell\_module\_punk::path](doc/files/punk/\_module\_path\-0\.1\.0\.tm\.md) Filesystem path utilities
diff --git a/src/embedded/www/.doc/tocdoc b/src/embedded/www/.doc/tocdoc
index 2639f7d7..1ee30657 100644
--- a/src/embedded/www/.doc/tocdoc
+++ b/src/embedded/www/.doc/tocdoc
@@ -3,6 +3,7 @@
[item doc/files/project_changes.html punkshell__project_changes {punkshell Changes}]
[item doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}]
[item doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}]
+[item doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}]
[item doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {pmix commandset - project}]
[item doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}]
[toc_end]
diff --git a/src/embedded/www/.idx b/src/embedded/www/.idx
index 96e73879..60d2db40 100644
--- a/src/embedded/www/.idx
+++ b/src/embedded/www/.idx
@@ -1 +1 @@
-{shell {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}} changelog {{doc/files/project_changes.html punkshell__project_changes}} filesystem {{doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} path {{doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} capability {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap}} module {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} punk {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}} plugin {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap}} repl {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}}} {{repl doc/files/main.html punkshell} . {punk doc/files/project_intro.html punkshell__project_intro} . {capability doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {changelog doc/files/project_changes.html punkshell__project_changes} . {shell doc/files/project_changes.html punkshell__project_changes} . {shell doc/files/main.html punkshell} . {repl doc/files/project_intro.html punkshell__project_intro} . {module doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {plugin doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {filesystem doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {path doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {module doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {punk doc/files/project_changes.html punkshell__project_changes} . {shell doc/files/project_intro.html punkshell__project_intro} . {punk doc/files/main.html punkshell} . {repl doc/files/project_changes.html punkshell__project_changes} .} 9 {shell shell changelog changelog filesystem filesystem path path capability capability module module punk punk plugin plugin repl repl}
\ No newline at end of file
+{file {{doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline}} repl {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}} text {{doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline}} shell {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}} changelog {{doc/files/project_changes.html punkshell__project_changes}} capability {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap}} parse {{doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline}} filesystem {{doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} path {{doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} module {{doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline} {doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path}} punk {{doc/files/project_intro.html punkshell__project_intro} {doc/files/project_changes.html punkshell__project_changes} {doc/files/main.html punkshell}} plugin {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap}}} {{repl doc/files/main.html punkshell} . {file doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline} . {punk doc/files/project_intro.html punkshell__project_intro} . {capability doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {shell doc/files/project_changes.html punkshell__project_changes} . {changelog doc/files/project_changes.html punkshell__project_changes} . {shell doc/files/main.html punkshell} . {text doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline} . {repl doc/files/project_intro.html punkshell__project_intro} . {module doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {path doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {plugin doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap} . {filesystem doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {module doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path} . {shell doc/files/project_intro.html punkshell__project_intro} . {punk doc/files/project_changes.html punkshell__project_changes} . {parse doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline} . {punk doc/files/main.html punkshell} . {module doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline} . {repl doc/files/project_changes.html punkshell__project_changes} .} 12 {file file repl repl text text shell shell changelog changelog capability capability parse parse filesystem filesystem path path module module punk punk plugin plugin}
\ No newline at end of file
diff --git a/src/embedded/www/.toc b/src/embedded/www/.toc
index bb33be84..4fa3f016 100644
--- a/src/embedded/www/.toc
+++ b/src/embedded/www/.toc
@@ -1 +1 @@
-doc {doc/toc {{doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}} {doc/files/project_changes.html punkshell__project_changes {punkshell Changes}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {pmix commandset - project}} {doc/files/main.html punkshell {punkshell - Core}}}}
\ No newline at end of file
+doc {doc/toc {{doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::fileline {file line-handling utilities}} {doc/files/punk/_module_cap-0.1.0.tm.html punkshell_module_punk::cap {capability provider and handler plugin system}} {doc/files/project_intro.html punkshell__project_intro {Introduction to punkshell}} {doc/files/punk/_module_path-0.1.0.tm.html punkshell_module_punk::path {Filesystem path utilities}} {doc/files/project_changes.html punkshell__project_changes {punkshell Changes}} {doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html punkshell_module_punk::mix::commandset::project {pmix commandset - project}} {doc/files/main.html punkshell {punkshell - Core}}}}
\ No newline at end of file
diff --git a/src/embedded/www/.xrf b/src/embedded/www/.xrf
index ea711d2a..623ccbfd 100644
--- a/src/embedded/www/.xrf
+++ b/src/embedded/www/.xrf
@@ -1 +1 @@
-kw,capability {index.html capability} punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.html sa,punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {punkshell Changes} doc/files/project_changes.html {Introduction to punkshell} doc/files/project_intro.html punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html sa,punkshell(n) doc/files/main.html filesystem {index.html filesystem} sa,punkshell doc/files/main.html kw,shell {index.html shell} sa,punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.html sa,punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.html sa,punkshell__project_changes(n) doc/files/project_changes.html kw,path {index.html path} kw,module {index.html module} punkshell(n) doc/files/main.html kw,plugin {index.html plugin} punkshell doc/files/main.html punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.html changelog {index.html changelog} punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.html punkshell__project_changes(n) doc/files/project_changes.html sa,punkshell__project_changes doc/files/project_changes.html path {index.html path} sa,punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.html punkshell__project_changes doc/files/project_changes.html kw,filesystem {index.html filesystem} sa,punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html shell {index.html shell} punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.html kw,repl {index.html repl} capability {index.html capability} punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {punkshell - Core} doc/files/main.html {pmix commandset - project} doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {capability provider and handler plugin system} doc/files/punk/_module_cap-0.1.0.tm.html repl {index.html repl} kw,punk {index.html punk} sa,punkshell__project_intro(n) doc/files/project_intro.html sa,punkshell__project_intro doc/files/project_intro.html {Filesystem path utilities} doc/files/punk/_module_path-0.1.0.tm.html sa,punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.html punkshell__project_intro(n) doc/files/project_intro.html punkshell__project_intro doc/files/project_intro.html kw,changelog {index.html changelog} punk {index.html punk} module {index.html module} plugin {index.html plugin}
\ No newline at end of file
+kw,capability {index.html capability} punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.html sa,punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {punkshell Changes} doc/files/project_changes.html {Introduction to punkshell} doc/files/project_intro.html sa,punkshell_module_punk::fileline(0) doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::mix::commandset::project(0) doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html sa,punkshell(n) doc/files/main.html filesystem {index.html filesystem} sa,punkshell doc/files/main.html kw,shell {index.html shell} sa,punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.html sa,punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.html kw,parse {index.html parse} sa,punkshell__project_changes(n) doc/files/project_changes.html kw,path {index.html path} kw,module {index.html module} punkshell_module_punk::fileline(0) doc/files/punk/_module_fileline-0.1.0.tm.html punkshell(n) doc/files/main.html kw,plugin {index.html plugin} punkshell doc/files/main.html kw,file {index.html file} punkshell_module_punk::cap doc/files/punk/_module_cap-0.1.0.tm.html changelog {index.html changelog} punkshell_module_punk::cap(0) doc/files/punk/_module_cap-0.1.0.tm.html punkshell__project_changes(n) doc/files/project_changes.html sa,punkshell__project_changes doc/files/project_changes.html path {index.html path} file {index.html file} sa,punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.html punkshell__project_changes doc/files/project_changes.html kw,filesystem {index.html filesystem} sa,punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html shell {index.html shell} punkshell_module_punk::path doc/files/punk/_module_path-0.1.0.tm.html kw,repl {index.html repl} capability {index.html capability} kw,text {index.html text} parse {index.html parse} sa,punkshell_module_punk::fileline doc/files/punk/_module_fileline-0.1.0.tm.html punkshell_module_punk::mix::commandset::project doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {punkshell - Core} doc/files/main.html {pmix commandset - project} doc/files/punk/mix/commandset/_module_project-0.1.0.tm.html {capability provider and handler plugin system} doc/files/punk/_module_cap-0.1.0.tm.html repl {index.html repl} punkshell_module_punk::fileline doc/files/punk/_module_fileline-0.1.0.tm.html kw,punk {index.html punk} sa,punkshell__project_intro(n) doc/files/project_intro.html text {index.html text} sa,punkshell__project_intro doc/files/project_intro.html {Filesystem path utilities} doc/files/punk/_module_path-0.1.0.tm.html sa,punkshell_module_punk::path(0) doc/files/punk/_module_path-0.1.0.tm.html punkshell__project_intro(n) doc/files/project_intro.html {file line-handling utilities} doc/files/punk/_module_fileline-0.1.0.tm.html punkshell__project_intro doc/files/project_intro.html kw,changelog {index.html changelog} module {index.html module} punk {index.html punk} plugin {index.html plugin}
\ No newline at end of file
diff --git a/src/embedded/www/doc/files/punk/_module_fileline-0.1.0.tm.html b/src/embedded/www/doc/files/punk/_module_fileline-0.1.0.tm.html
new file mode 100644
index 00000000..5519d64f
--- /dev/null
+++ b/src/embedded/www/doc/files/punk/_module_fileline-0.1.0.tm.html
@@ -0,0 +1,326 @@
+
+punkshell_module_punk::fileline - punk fileline
+
+
+
+
+
+
[
+ Main Table Of Contents
+| Table Of Contents
+| Keyword Index
+ ]
+
diff --git a/src/embedded/www/doc/files/punk/_module_path-0.1.0.tm.html b/src/embedded/www/doc/files/punk/_module_path-0.1.0.tm.html
index 1f9e868e..24a2a427 100644
--- a/src/embedded/www/doc/files/punk/_module_path-0.1.0.tm.html
+++ b/src/embedded/www/doc/files/punk/_module_path-0.1.0.tm.html
@@ -190,8 +190,8 @@
ie - the driveletter alone in paths such as c:/etc will still be case insensitive. (ie c:/ETC/* will match C:/ETC/blah but not C:/etc/blah)
Explicitly specifying -nocase 0 will require the entire case to match including the driveletter.
treefilenames basepath tailglob ?option value...?
-basic (glob based) list of filenames matching tailglob - recursive
-no natsorting - so order is dependent on filesystem
+basic (glob based) list of filenames matching tailglob - recursive
+no natsorting - so order is dependent on filesystem
relative reference location
Taking two directory paths, a reference and a location, computes the path
of the location relative to the reference.
@@ -210,14 +210,31 @@ no natsorting - so order is dependent on filesystem
Will return a single dot "." if the paths are the same
Notes:
Both paths must be the same type - ie both absolute or both relative
-Case sensitive. ie relative /etc /etC
+
Case sensitive. ie punk::path::relative /etc /etC
will return ../etC
On windows, the drive-letter component (only) is not case sensitive
-ie relative c:/etc C:/etc returns .
-but relative c:/etc C:/Etc returns ../Etc
-On windows, if the paths are absolute and specifiy different volumes, only the location will be returned.
- ie relative c:/etc d:/etc/blah
- returns d:/etc/blah
+
+ P% punk::path::relative c:/etc C:/etc
+ - .
+
+The part following the driveletter is case sensitive so in the following cases it recognises the driveletter matches but not the tail
+
+ P% punk::path::relative c:/etc C:/Etc
+ - ../Etc
+
+On windows, if the paths are absolute and specifiy different volumes, only the location will be returned.
+
+ P% punk::path::relative c:/etc d:/etc/blah
+ - d:/etc/blah
+
+Unix-like examples:
+
+ P% punk::path::relative /usr/local/etc/ /usr/local/etc/somewhere/below
+ - somewhere/below
+ P% punk::path::relative /usr/local/etc/somewhere /usr/local/lib/here
+ - ../../lib/here
+
+
diff --git a/src/embedded/www/doc/toc.html b/src/embedded/www/doc/toc.html
index 0bc5e90c..55deb295 100644
--- a/src/embedded/www/doc/toc.html
+++ b/src/embedded/www/doc/toc.html
@@ -29,10 +29,14 @@
capability provider and handler plugin system |
+punkshell_module_punk::fileline |
+file line-handling utilities |
+
+
punkshell_module_punk::mix::commandset::project |
pmix commandset - project |
-
+
punkshell_module_punk::path |
Filesystem path utilities |
diff --git a/src/embedded/www/index.html b/src/embedded/www/index.html
index 57292163..7bd7a53e 100644
--- a/src/embedded/www/index.html
+++ b/src/embedded/www/index.html
@@ -13,7 +13,7 @@
]
Keyword Index