Connecting Tech Pros Worldwide Forums | Help | Site Map

Files not loading when path changed

elShazo@gmail.com
Guest
 
Posts: n/a
#1: Apr 22 '07
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?


Ian Collins
Guest
 
Posts: n/a
#2: Apr 22 '07

re: Files not loading when path changed


elShazo@gmail.com wrote:
Quote:
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.
elShazo@gmail.com
Guest
 
Posts: n/a
#3: Apr 22 '07

re: Files not loading when path changed


On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.comwrote:
Quote:
elSh...@gmail.com wrote:
Quote:
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).
>
Quote:
Program is being developed in Fedora Core 6, using C++ and Qt3.
>
Quote:
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");"?

Ian Collins
Guest
 
Posts: n/a
#4: Apr 22 '07

re: Files not loading when path changed


elShazo@gmail.com wrote:
Quote:
On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.comwrote:
>
Quote:
>>elSh...@gmail.com wrote:
>>
Quote:
>>>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).
>>
Quote:
>>>Program is being developed in Fedora Core 6, using C++ and Qt3.
>>
Quote:
>>>Any ideas?
>>
>>Again, you don't post enough information to get a meaningful answer.
>>
*Please* don't quote signatures.
Quote:
>
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.
Gianni Mariani
Guest
 
Posts: n/a
#5: Apr 22 '07

re: Files not loading when path changed


elShazo@gmail.com wrote:
....
Quote:
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...


Philo
Guest
 
Posts: n/a
#6: Apr 23 '07

re: Files not loading when path changed


On Apr 23, 6:12 am, Ian Collins <ian-n...@hotmail.comwrote:
Quote:
elSh...@gmail.com wrote:
Quote:
On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.comwrote:
>
Quote:
Quote:
>elSh...@gmail.com wrote:
>
Quote:
Quote:
>>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).
>
Quote:
Quote:
>>Program is being developed in Fedora Core 6, using C++ and Qt3.
>
Quote:
Quote:
>>Any ideas?
>
Quote:
Quote:
>Again, you don't post enough information to get a meaningful answer.
>
*Please* don't quote signatures.
>
>
>
Quote:
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?

Ian Collins
Guest
 
Posts: n/a
#7: Apr 23 '07

re: Files not loading when path changed


Philo wrote:
Quote:
Quote:
>>
>><OT>Any pathname starting with a '/' is a full pathname.</OT>
>>
*Please* trim signatures and that google quoted test crap.
Quote:
>
>
Any pathname starting with a '/' is a full pathname?
Are you sure of that?
>
On a UNIX like file system, yes.

--
Ian Collins.
Jim Langston
Guest
 
Posts: n/a
#8: Apr 23 '07

re: Files not loading when path changed


"Ian Collins" <ian-news@hotmail.comwrote in message
news:592bjtF2iko4pU14@mid.individual.net...
Quote:
Philo wrote:
Quote:
Quote:
>>>
>>><OT>Any pathname starting with a '/' is a full pathname.</OT>
>>>
>
*Please* trim signatures and that google quoted test crap.
>
Quote:
>>
>>
>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"


Philo
Guest
 
Posts: n/a
#9: Apr 23 '07

re: Files not loading when path changed


On Apr 23, 9:42 am, "Jim Langston" <tazmas...@rocketmail.comwrote:
Quote:
"Ian Collins" <ian-n...@hotmail.comwrote in message
>
news:592bjtF2iko4pU14@mid.individual.net...
>
Quote:
Philo wrote:
>
Quote:
Quote:
>><OT>Any pathname starting with a '/' is a full pathname.</OT>
>
Quote:
*Please* trim signatures and that google quoted test crap.
>
Quote:
Quote:
Any pathname starting with a '/' is a full pathname?
Are you sure of that?
>
Quote:
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!

James Kanze
Guest
 
Posts: n/a
#10: Apr 23 '07

re: Files not loading when path changed


On Apr 23, 2:00 am, Philo <philo....@gmail.comwrote:
Quote:
On Apr 23, 6:12 am, Ian Collins <ian-n...@hotmail.comwrote:
[...]
Quote:
Quote:
<OT>Any pathname starting with a '/' is a full pathname.</OT>
Quote:
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:james.kanze@gmail.com
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

Closed Thread