\ BLK to FS converter \ Copyright (C) 2000 Alex Malyshev (alexript@mail.ru) \ This is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License \ as published by the Free Software Foundation; either version 2 \ of the License, or (at your option) any later version. \ This program is distributed in the hope that it will be useful, \ but WITHOUT ANY WARRANTY; without even the implied warranty of \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \ GNU General Public License for more details. \ You should have received a copy of the GNU General Public License \ along with this program; if not, write to the Free Software \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. \ --------------------------------------------------- \ blk2fs \ (c) Alex Malyshev (alexript@mail.ru) \ using: \ BLK2FS \ example: \ convert words.blk into words.fs \ blk2fs words \ \ --------------------------------------------------- \ \ this file included into MyUnits, but it is not Unit \ uses Files.fileio uses Strings.tmp_str : blk2fsrecode BEGIN 2DUP fget64chars 0= WHILE 0= IF DROP EXIT ELSE DUP fput64chars DROP #lf SWAP fputc DROP THEN REPEAT ; : /BLK2FS/ ( filename_c-addr filename_c-u -- ) ts! CR ts@ S" .blk" absfilename r/o open-file ( -- w2 wior ) IF ." Can't open .blk file" CR DROP EXIT THEN ." .blk file opened" CR ts@ S" .fs" absfilename w/o open-file IF ." Can't open .fs file" CR DROP close-file DROP EXIT THEN ." .fs file opened" CR SWAP blk2fsrecode close-file DROP close-file DROP ; : blk2fs ( | filename_c-addr filename_c-u -- ) name /blk2fs/ ;