Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Files not loading when path changed

Reply
Thread Tools

Files not loading when path changed

 
 
elShazo@gmail.com
Guest
Posts: n/a
 
      04-22-2007
Question: Program was originally developed in directory "/home/dude/
desktop/program" with subdirectores. I want the program and the files
it needs to run (images, settings files, etc.) from a new source. I
have changed the code to refer to just the subdirectories (i.e. /
images/terrain) instead of the fully qualified path (/home/dude/
desktop/program/images/terrain). Some of the images load and some do
not. The code appears to be correct, I just changed all fully
qualified paths to the /subdir. I also tried changing to a different
fully qualified path and had the same results (after copying the
needed files to the correct new location).

Program is being developed in Fedora Core 6, using C++ and Qt3.

Any ideas?

 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      04-22-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Question: Program was originally developed in directory "/home/dude/
> desktop/program" with subdirectores. I want the program and the files
> it needs to run (images, settings files, etc.) from a new source. I
> have changed the code to refer to just the subdirectories (i.e. /
> images/terrain) instead of the fully qualified path (/home/dude/
> desktop/program/images/terrain). Some of the images load and some do
> not. The code appears to be correct, I just changed all fully
> qualified paths to the /subdir. I also tried changing to a different
> fully qualified path and had the same results (after copying the
> needed files to the correct new location).
>
> Program is being developed in Fedora Core 6, using C++ and Qt3.
>
> Any ideas?
>

Again, you don't post enough information to get a meaningful answer.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
elShazo@gmail.com
Guest
Posts: n/a
 
      04-22-2007
On Apr 22, 4:43 pm, Ian Collins <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > Question: Program was originally developed in directory "/home/dude/
> > desktop/program" with subdirectores. I want the program and the files
> > it needs to run (images, settings files, etc.) from a new source. I
> > have changed the code to refer to just the subdirectories (i.e. /
> > images/terrain) instead of the fully qualified path (/home/dude/
> > desktop/program/images/terrain). Some of the images load and some do
> > not. The code appears to be correct, I just changed all fully
> > qualified paths to the /subdir. I also tried changing to a different
> > fully qualified path and had the same results (after copying the
> > needed files to the correct new location).

>
> > Program is being developed in Fedora Core 6, using C++ and Qt3.

>
> > Any ideas?

>
> Again, you don't post enough information to get a meaningful answer.
>
> --
> Ian Collins.



Well, I was hoping for a general "here's where to start looking" kind
of answer. Such as, can you use a non-fully qualified file name like
this "mySettingsIFile.open ("/gameSettings/gameSettings.txt");" or
would you have to use a fully qualified name such as this
"mySettingsIFile.open ("/usr/games/TrafficKing/gameSettings/
gameSettings.txt");"?

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      04-22-2007
(E-Mail Removed) wrote:
> On Apr 22, 4:43 pm, Ian Collins <(E-Mail Removed)> wrote:
>
>>(E-Mail Removed) wrote:
>>
>>>Question: Program was originally developed in directory "/home/dude/
>>>desktop/program" with subdirectores. I want the program and the files
>>>it needs to run (images, settings files, etc.) from a new source. I
>>>have changed the code to refer to just the subdirectories (i.e. /
>>>images/terrain) instead of the fully qualified path (/home/dude/
>>>desktop/program/images/terrain). Some of the images load and some do
>>>not. The code appears to be correct, I just changed all fully
>>>qualified paths to the /subdir. I also tried changing to a different
>>>fully qualified path and had the same results (after copying the
>>>needed files to the correct new location).

>>
>>>Program is being developed in Fedora Core 6, using C++ and Qt3.

>>
>>>Any ideas?

>>
>>Again, you don't post enough information to get a meaningful answer.
>>


*Please* don't quote signatures.

>
> Well, I was hoping for a general "here's where to start looking" kind
> of answer. Such as, can you use a non-fully qualified file name like
> this "mySettingsIFile.open ("/gameSettings/gameSettings.txt");" or
> would you have to use a fully qualified name such as this
> "mySettingsIFile.open ("/usr/games/TrafficKing/gameSettings/
> gameSettings.txt");"?
>

<OT>Any pathname starting with a '/' is a full pathname.</OT>

--
Ian Collins.
 
Reply With Quote
 
Gianni Mariani
Guest
Posts: n/a
 
      04-22-2007
(E-Mail Removed) wrote:
....
> Well, I was hoping for a general "here's where to start looking" kind
> of answer. Such as, can you use a non-fully qualified file name like
> this "mySettingsIFile.open ("/gameSettings/gameSettings.txt");" or
> would you have to use a fully qualified name such as this
> "mySettingsIFile.open ("/usr/games/TrafficKing/gameSettings/
> gameSettings.txt");"?
>


If you're running on Linux then do an strace of the program and see what
it's doing, when you figure out what you really want it to do then
program that. Under windows there is a similar utility for logging file
accesses.


Nothing here is specific to C++ tho...


 
Reply With Quote
 
Philo
Guest
Posts: n/a
 
      04-23-2007
On Apr 23, 6:12 am, Ian Collins <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > On Apr 22, 4:43 pm, Ian Collins <(E-Mail Removed)> wrote:

>
> >>(E-Mail Removed) wrote:

>
> >>>Question: Program was originally developed in directory "/home/dude/
> >>>desktop/program" with subdirectores. I want the program and the files
> >>>it needs to run (images, settings files, etc.) from a new source. I
> >>>have changed the code to refer to just the subdirectories (i.e. /
> >>>images/terrain) instead of the fully qualified path (/home/dude/
> >>>desktop/program/images/terrain). Some of the images load and some do
> >>>not. The code appears to be correct, I just changed all fully
> >>>qualified paths to the /subdir. I also tried changing to a different
> >>>fully qualified path and had the same results (after copying the
> >>>needed files to the correct new location).

>
> >>>Program is being developed in Fedora Core 6, using C++ and Qt3.

>
> >>>Any ideas?

>
> >>Again, you don't post enough information to get a meaningful answer.

>
> *Please* don't quote signatures.
>
>
>
> > Well, I was hoping for a general "here's where to start looking" kind
> > of answer. Such as, can you use a non-fully qualified file name like
> > this "mySettingsIFile.open ("/gameSettings/gameSettings.txt");" or
> > would you have to use a fully qualified name such as this
> > "mySettingsIFile.open ("/usr/games/TrafficKing/gameSettings/
> > gameSettings.txt");"?

>
> <OT>Any pathname starting with a '/' is a full pathname.</OT>
>
> --
> Ian Collins.- Hide quoted text -
>
> - Show quoted text -


Any pathname starting with a '/' is a full pathname?
Are you sure of that?

 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      04-23-2007
Philo wrote:
>>
>><OT>Any pathname starting with a '/' is a full pathname.</OT>
>>


*Please* trim signatures and that google quoted test crap.

>
>
> Any pathname starting with a '/' is a full pathname?
> Are you sure of that?
>

On a UNIX like file system, yes.

--
Ian Collins.
 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      04-23-2007
"Ian Collins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Philo wrote:
>>>
>>><OT>Any pathname starting with a '/' is a full pathname.</OT>
>>>

>
> *Please* trim signatures and that google quoted test crap.
>
>>
>>
>> Any pathname starting with a '/' is a full pathname?
>> Are you sure of that?
>>

> On a UNIX like file system, yes.


On a DOS/Windows like file system too.

If you want a path off of the current path, you leave off the first /.
"somedir/someotherdir/someotherotherdir/somefile"


 
Reply With Quote
 
Philo
Guest
Posts: n/a
 
      04-23-2007
On Apr 23, 9:42 am, "Jim Langston" <(E-Mail Removed)> wrote:
> "Ian Collins" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> > Philo wrote:

>
> >>><OT>Any pathname starting with a '/' is a full pathname.</OT>

>
> > *Please* trim signatures and that google quoted test crap.

>
> >> Any pathname starting with a '/' is a full pathname?
> >> Are you sure of that?

>
> > On a UNIX like file system, yes.

>
> On a DOS/Windows like file system too.
>
> If you want a path off of the current path, you leave off the first /.
> "somedir/someotherdir/someotherotherdir/somefile"


lan\Jim,
Thanks!

 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      04-23-2007
On Apr 23, 2:00 am, Philo <(E-Mail Removed)> wrote:
> On Apr 23, 6:12 am, Ian Collins <(E-Mail Removed)> wrote:

[...]
> > <OT>Any pathname starting with a '/' is a full pathname.</OT>


> Any pathname starting with a '/' is a full pathname?
> Are you sure of that?


Well, it depends on the system. (That's why he put the <OT>
around it, I'm sure.) Under Unix, any pathname starting with
'/' (and no other pathnames) is an absolute pathname; i.e. a
pathname taken from the system root, and not from the current
directory. The rules for Windows are considerably more
complicated, but any pathname starting with '/' or '\\' is
interpreted as an absolute pathname on the currently selected
drive, taken from the root of the currently selected drive;
there are also other formats which are considered absolute. I
match the regular expression:
absolute( "[[:alpha:]]:"
"|[/\\\\][/\\\\][^<>:\"/\\\\\\|]+[/\\\\][^<>:\"/\\\\\\|]
+" ) ;
in my own code. (Note that both the compiler and the regular
expression parser interpret backslashes, so that it takes four
backslashes in a row to literally match a single backslash, and
two for the regular expressions parser to see it. So that
something like "\\\\\\|" means a literal backslash, followed by
a literal | character.)

--
James Kanze (GABI Software) email:(E-Mail Removed)
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changed Resource Loading in Java Webstart JDK 1.5.0_16? Andi Java 3 08-04-2008 05:20 PM
changed state to up changed state to down FastEthernet LINEPROTO-5-UPDOWN surrealarmada@gmail.com Cisco 3 03-07-2007 06:06 PM
scroll position is changed when style is changed? mxbrunet Javascript 1 11-03-2006 03:40 AM
Image files changed to DAT files on VCD. Den Computer Support 3 09-18-2006 08:53 PM
xmlDocument.Save "&#10;" getting changed changed to "&amp;#10" st@jpa.co.jp ASP .Net 1 10-11-2005 01:30 PM



Advertisments