delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/06/23/09:47:35

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc 3.1 - space characters in file name
Date: Sun, 23 Jun 2002 14:01:16 +0100
Lines: 35
Message-ID: <3D15C69C.32B1B70D@phekda.freeserve.co.uk>
References: <46552825 DOT 0206230356 DOT 22493c14 AT posting DOT google DOT com>
NNTP-Posting-Host: modem-20.dextroamphetam.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: newsg3.svr.pol.co.uk 1024839332 15370 62.136.90.20 (23 Jun 2002 13:35:32 GMT)
NNTP-Posting-Date: 23 Jun 2002 13:35:32 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

andrzej wrote:
> I am not able to open files whose name contain spaces,like "this is an
> example". I am using gcc version 3.1 compiler and fopen function; have
> tried double quotes and backslash e.g. '"this is an example"' and
> 'this\ is\ an\ example' without any success, although at least one of
> these works fine one gnu utilities.
> 
> Thanks in advance for your kind help.

It should work. Presumably you're trying some like this:

#include <stdio.h>

int
somefunc (void)
{
  FILE *f;

  f = fopen("this is a file", "rb");
  if (!f)
    return(0);
  ...
  fclose(f);

  return(1);
}

If you post you're code, it might help diagnose the problem.

Regards,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019