home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / perl / 7386 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.7 KB  |  41 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!caen!uvaarpa!mmdf
  3. From: Dov Grobgeld <dov@menora.weizmann.ac.il>
  4. Subject: Re: Wanted: Perl script to convert file names from Unix to DOS
  5. Message-ID: <1992Dec13.082341.22989@uvaarpa.Virginia.EDU>
  6. Sender: mmdf@uvaarpa.Virginia.EDU (Mail System)
  7. Reply-To: dov@menora.weizmann.ac.il
  8. Organization: The Internet
  9. Date: Sun, 13 Dec 1992 08:23:41 GMT
  10. Lines: 29
  11.  
  12. In his message ayman@eecs.umich.edu (Ayman I. Kayssi) said:
  13.  
  14. | : 
  15. | : >It would be nice if the algorithm used can be
  16. | : >inverted, so that the Unix filenames can be extracted back from their
  17. | : >DOS translation.
  18. | : 
  19. | : In general, I don't think that will be possible unless the Unix filenames
  20. | : are already in 8x3 format with no unacceptable characters.   The only way 
  21. | : you could do it reliably would be to save a table and use it for the
  22. | : conversion back.
  23. | I thought so too, but maybe there is some  magic way to do it.
  24.  
  25. You cannot do a one-to-one mapping between a larger set and a smaller set.
  26. Since the set of allowed unix file names is much larger than the set of
  27. allowed DOS file names, your case is hopeless. It is mathematically impossible
  28. to do what you want to do. The only way around it is by a providing a
  29. lookup table of how you did the translation.
  30.  
  31. --
  32.                                                         ___   ___
  33.                                                       /  o  \   o \
  34. Dov Grobgeld                                         ( o  o  ) o   |
  35. The Weizmann Institute of Science, Israel             \  o  /o  o /
  36. "Where the tree of wisdom carries oranges"              | |   | |
  37.                                                        _| |_ _| |_
  38.                                        
  39.