Re: Testing for the existence of a file

From: Vassil Nikolov (vnikolov_at_poboxes.com)
Date: 08/31/04


Date: Mon, 30 Aug 2004 23:18:36 -0400

Pascal Bourguignon <spam@mouse-potato.com> writes:

> Barry Margolin <barmar@alum.mit.edu> writes:
>
>> In article <87d619nrsj.fsf@david-steuber.com>,
>> David Steuber <david@david-steuber.com> wrote:
>>
>> > Is there a simple way to use a wild pathname to find both foo.data and
>> > foo.data.gz? Or do I have to construct a pathname for each?
>>
>> I don't think there's an easy way to match both at once without possibly
>> matching other names. foo.data is name "foo" and type "data", while
>> foo.data.gz is name "foo.data" and type "gz". You could try:
>>
>> (directory "foo*.*")
>>
>> but this will also match things like foobar.data.
>
> That is to say, Common-Lisp CANNOT access all the files and items in
> your file system! (ie. CANNOT reliably and portably).
>
> To handle this dot problem, perhaps you should rename all the items to
> match the "portability" rule of file systems:
>
> Use only one dot, preceded between one and eight letters, digits,
> underline or dash, and followed between one and three letters,
> digits, underline or dash.

  ...where each letter is one of the 26 uppercase letters of the
  English alphabet. For even better portability, do not assume that
  the file name and the file type will always be separated by a dot in
  the pathnmame strings used by the operating system.

  ---Vassil.

-- 
Vassil Nikolov <vnikolov@poboxes.com>
Hollerith's Law of Docstrings: Everything can be summarized in 72 bytes.


Relevant Pages

  • Re: Formula to check email address
    ... The part before the "@" consists of any combination of English letters, digits, ... dot, underscore, percent sign or dash. ... of English letters, digits, dot or dash. ...
    (microsoft.public.excel.misc)
  • Re: Testing for the existence of a file
    ... your file system! ... Use only one dot, preceded between one and eight letters, digits, ... underline or dash, and followed between one and three letters, ... digits, underline or dash. ...
    (comp.lang.lisp)
  • File naming when ripping - Can I add a space on both sides of the
    ... In WMP 10, you can select different separators to appear when ripping your CD ... You can choose from space, dash, dot, and underline. ...
    (microsoft.public.windowsmedia.player)
  • Re: Testing for the existence of a file
    ... >> To handle this dot problem, perhaps you should rename all the items to ... >> digits, underline or dash. ... But you can assume that the file name and the file type will always be ...
    (comp.lang.lisp)
  • Re: Is the Curt net a kind of decision tree?
    ... The very simple problem of trying to tell Dot Dash ... decisions based on two separate pulse sources. ... always other pulses to compare to. ...
    (comp.ai.philosophy)