[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File path issue on Win32 only

From: Michael Hopkins
Subject: File path issue on Win32 only
Date: Fri, 23 Feb 2007 14:21:07 +0000
User-agent: Microsoft-Entourage/

Hi all

In a Foundation tool, we initialise an object with a file in the path where
the executable resides:

  [[Experiment alloc] initFromFile:@"test.gpe"];

It uses this code internally:

  -(Experiment *)        initFromFile:(NSString *) filePath
    NSString*  file_off_disk = [NSString stringWithContentsOfFile:filePath];

This works fine on OS X and Linux, but gives the following error on Win32:

  2007-02-23 13:46:39.987 test.exe[1300] File NSData.m: 167. In
readContentsOfFile() attempt failed - The filename, directory name, or
volume label syntax is incorrect.

Tried this as an attempted quick fix but it doesn't help:

  [[Experiment alloc] initFromFile:[@"test.gpe" stringByStandardizingPath]];

Is there an object and/or method available in Foundation that lets me easily
convert local filenames to global ones in a form that all systems will




        _/    _/   _/_/_/             Hopkins Research Ltd
       _/    _/   _/    _/
      _/_/_/_/   _/_/_/
     _/    _/   _/   _/
    _/    _/   _/     _/               'touch the future'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]