473,770 Members | 4,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Files not loading when path changed

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?

Apr 22 '07 #1
9 1496
el*****@gmail.c om 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.
Apr 22 '07 #2
On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.co mwrote:
elSh...@gmail.c om 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 "mySettingsIFil e.open ("/gameSettings/gameSettings.tx t");" or
would you have to use a fully qualified name such as this
"mySettingsIFil e.open ("/usr/games/TrafficKing/gameSettings/
gameSettings.tx t");"?

Apr 22 '07 #3
el*****@gmail.c om wrote:
On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.co mwrote:
>>elSh...@gmail .com 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 "mySettingsIFil e.open ("/gameSettings/gameSettings.tx t");" or
would you have to use a fully qualified name such as this
"mySettingsIFil e.open ("/usr/games/TrafficKing/gameSettings/
gameSettings.tx t");"?
<OT>Any pathname starting with a '/' is a full pathname.</OT>

--
Ian Collins.
Apr 22 '07 #4
el*****@gmail.c om 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 "mySettingsIFil e.open ("/gameSettings/gameSettings.tx t");" or
would you have to use a fully qualified name such as this
"mySettingsIFil e.open ("/usr/games/TrafficKing/gameSettings/
gameSettings.tx t");"?
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...
Apr 22 '07 #5
On Apr 23, 6:12 am, Ian Collins <ian-n...@hotmail.co mwrote:
elSh...@gmail.c om wrote:
On Apr 22, 4:43 pm, Ian Collins <ian-n...@hotmail.co mwrote:
>elSh...@gmail. com 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 "mySettingsIFil e.open ("/gameSettings/gameSettings.tx t");" or
would you have to use a fully qualified name such as this
"mySettingsIFil e.open ("/usr/games/TrafficKing/gameSettings/
gameSettings.tx t");"?

<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?

Apr 23 '07 #6
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.
Apr 23 '07 #7
"Ian Collins" <ia******@hotma il.comwrote in message
news:59******** ******@mid.indi vidual.net...
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/someotherotherd ir/somefile"
Apr 23 '07 #8
On Apr 23, 9:42 am, "Jim Langston" <tazmas...@rock etmail.comwrote :
"Ian Collins" <ian-n...@hotmail.co mwrote in message

news:59******** ******@mid.indi vidual.net...
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/someotherotherd ir/somefile"
lan\Jim,
Thanks!

Apr 23 '07 #9
On Apr 23, 2:00 am, Philo <philo....@gmai l.comwrote:
On Apr 23, 6:12 am, Ian Collins <ian-n...@hotmail.co mwrote:
[...]
<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:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 23 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3729
by: Xah Lee | last post by:
suppose you want to do find & replace of string of all files in a directory. here's the code: ©# -*- coding: utf-8 -*- ©# Python © ©import os,sys © ©mydir= '/Users/t/web'
2
3140
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the dynamic loading code will go. The assemblies being dynamically loaded do not contain any code. They are resource-only assemblies. I have succeeded in dynamically loading them within the same AppDomain as the main application (a Winforms EXE that...
2
9029
by: Vanga Sasidhar | last post by:
Already posted the same message but the date and time of my machine was set back. and it was listed under the old date. Thats why I am posting the same message again. Please accept this. ------------------------------------------------------------------------------------ Hi All, I have some AVI files and i want to create a program which will open an AVI file from the hard disk at runtime and run that Video. But here i want
10
7838
by: Martin Ho | last post by:
I am running into one really big problem. I wrote a script in vb.net to make a copy of folders and subfolder to another destination: - in 'from.txt' I specify which folders to copy - in 'to.txt' I specify where to copy it - After I read content of 'to.txt' I create one more subfolder named by current date and thats where everything gets to be copied
0
2394
by: richardkreidl | last post by:
I have the following hash script that I use to compare two text files. 'Class Public Class FileComparison Public Class FileComparisonException Public Enum ExceptionType U 'Unknown A 'Add D 'Delete
2
1799
by: Dave A | last post by:
I just don't get this... If I need to dynamically load controls into a web page I simply need to go PlaceHolder1.Controls.Add(new Button()); or similar. However when I need to dynamically load a web user control into a web page then if we use the same syntax it will appear to work but the web control will throw all sorts of null reference exceptions. Rather for web user controls you have to use the syntax ...
4
6434
by: Shiraz | last post by:
Hi I'm using Visual Studio Installer to make my installer, and have not as yet figured out a straightforward way to use it to set environmental variables. Amongst the various things I tried, I'm thinking the following might help. I would appreciate if someone could comment on this idea and possibly suggest a better one: The environement variable in question is 'Path' in the HKCU registry folder's Environment key. I want to add some...
15
3688
by: pdhb_1 | last post by:
I'm trying to run Apache2.2.6 with php. However, I keep getting a long list of error messages in the log file indicating that includes are failing. For example, "PHP Warning: PHP Startup: Unable to load dynamic library './ext/ php_sybase_ct.dll' - The specified module could not be found.\r\n in Unknown on line 0" I have changed the "extension_dir" line in the php.ini file every way I can think of, including the original:
15
1419
by: Andy B | last post by:
I need to count files in a certain directory that has the string -Contract Template.xml at the end of it. How would I do this?
0
10230
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.