> >> Does ksh have an API to edit a file at a specific position pos1, read > >> n1 bytes, and write n1 bytes at that position without truncating the > >> file? I need this to do edit a file in place without reading and > >> writing it completely each time. > > > > Yes, ksh has seek redirection operators. > > [snip] > > > > > > read -N "$n1" content 0<>"$f" <#((pos1)) > > printf "%s" "$(fun "$content")" 1<>"$f" >#((pos1)) > >
[snip] > > How would this example look like if I opened a file descriptor with > the number 19? ksh seems to use file descriptors 0-9 for manual usage, > but descriptors opened with exec {filed}<>"name.rec" use numbers > 10. I'd have thought by prepending {filed} to the seek redirections; {filed}<#((pos1)) and {filed}>#((pos1)) respectively. Doesn't that work? Janis > > Tina > -- > Tina Harriott - Women in Mathematics > Contact: tina.harriott.mathemat...@gmail.com
_______________________________________________ ast-users mailing list ast-users@lists.research.att.com http://lists.research.att.com/mailman/listinfo/ast-users