home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / pc / linux / extra / docs / maillist / text / archive.96 / text2046.txt < prev    next >
Encoding:
Text File  |  1996-07-25  |  2.3 KB  |  56 lines

  1. John Hess (johnhess@cris.com) wrote:
  2. : :At 04:14 PM 4/2/96 -0500, Matt `The Man` Galgoci wrote:
  3. : :Hi-
  4. : :    I realize that in order to use a disk image as a hfv, the first 
  5. : :84 bytes must be stripped off the beginning and the image renamed using 
  6. : :*.hfv convention.  Right now, with DOS, I'm not aware of any methods 
  7. : :that I can use to do this.  (Yes, I do know how to rename files :-))
  8. : :Could a Hex editor be used? How about any of the Norton Utilities?
  9.  
  10. : My question is, how do I get the file to copy back to the DOS area so I CAN 
  11. : edit it after I un-hqx/sit/sea it? 
  12. Any file that is on a HFV volume can be copied back to a DOS volume if it
  13. is renamed to 7.3 chars, the 8th is taken up by the % sign that is prepended
  14. to the name to get a 2nd filename for the resource fork. Or you could
  15. encode the file in MacBinary format, copy it to a DOS volume and then
  16. decode it with a DOS macbin program (from e.g. SimTel), this will probably
  17. extract only the data fork and choose a name that is valid in DOS.
  18.  
  19.  
  20. : If you have the actual image file in 
  21. : DOS, you should be able to strip the first 84 bits with the following BASIC 
  22. : code.  Note that it is written free-hand on line.  As always when mucking 
  23. : about with a file you want to keep, save it somewhere else before mucking 
  24. : about with it.
  25.  
  26. : 10  Open "filename.ext" for input as #1 
  27. : 20  Open "newname.ext" for output as #2
  28. : 30  x=1
  29. : 40  while not eof(1)
  30. : 50  a$=input$(1,1)
  31. : 60  if x > 84 then print #2,a$
  32. : 70  x=x+1
  33. : 80  a$=""
  34. : 90  wend
  35.  
  36. Hm, this probably doesn't work, since DOS distinguishes between text and
  37. binary files and the basic runtime will remove all CRs (0x0d) from the file
  38. and even worse, the file with be considered finished at the first ^Z (0x1a)(*).
  39. I have no idea if there is something like a binary open mode in BASIC, I would
  40. suggest writing a C or Pascal program. Or you could use dd or tail if you
  41. have access to a unix system (maybe there is a dd format for DOS somewhere).
  42.  
  43.  
  44. bye, Alexander
  45.  
  46.  
  47. (*) At least I think that is what is does, pretty long since I wrote BASIC
  48. programs at all.
  49.  
  50. --
  51. Alexander Lehmann,                                  |  "On the Internet,
  52. alex@hal.rhein-main.de  (plain, MIME, NeXT)         |   nobody knows
  53. alexlehm@rbg.informatik.th-darmstadt.de (plain)     |   you're a dog."
  54. <URL:http://www.student.informatik.th-darmstadt.de/~alexlehm/>
  55.  
  56.