On page 25 of the userguide it refers to a section on "File Name Specifications and File Paths" and something called relative file paths. I can't find the section though
Can someone please explain how to and when to use the different file path types? I seem to be having a very difficult time getting relative filepaths to work. For example, I think relative refers to where the Revolution media is located, so if I have a folder named "myStuff" containing "myMov.mov" in the "Revolution Media" folder, how do I refer to it? the movie file?
Thanks for reading,
-JT
absolute vs relative file paths
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Hi JT,
An absolute file path is something that points from the root of the system to the file / folder in question. Examples are:
Windows:
C:/Documents and Settings/myUserName/My Documents/program.rev
Mac:
/Users/myUserName/Documents/program.rev
Linux:
/home/myUserName/program.rev
An absolute path always points to that file, regardless of the the current directory or where your program is saved.
A relative path is simply a partial path to a file or folder, it is said to be "relative" because in order to get the actual (absolute) path, to the file / folder, you need to know the rest of the path (what it is "relative" to).
Examples are:
Windows, Mac or Linux:
Documents/program.rev
Relative paths are useful becuase the thing that the path is relative to can change. For example if you have a file in the same folder as your program, the relative path to that file is simply the name of the file eg
myFile.rev
Or if the file is in a folder called "Documents" which is in the same folder as your program:
Documents/myFile.rev
This is a good use of relative paths because it means you can move your program, and as long as the file is moved to the same place, ie relative to your program its still in the same place, you don't need to change any code.
With regards to your file myMov.mov, could you explain exactly where it is located? If you give me the absolute path of the file, and the absolute path of your stack / program I can explain how to use a relative path to access the file.
Hope this is some help.
Regards
Oliver
An absolute file path is something that points from the root of the system to the file / folder in question. Examples are:
Windows:
C:/Documents and Settings/myUserName/My Documents/program.rev
Mac:
/Users/myUserName/Documents/program.rev
Linux:
/home/myUserName/program.rev
An absolute path always points to that file, regardless of the the current directory or where your program is saved.
A relative path is simply a partial path to a file or folder, it is said to be "relative" because in order to get the actual (absolute) path, to the file / folder, you need to know the rest of the path (what it is "relative" to).
Examples are:
Windows, Mac or Linux:
Documents/program.rev
Relative paths are useful becuase the thing that the path is relative to can change. For example if you have a file in the same folder as your program, the relative path to that file is simply the name of the file eg
myFile.rev
Or if the file is in a folder called "Documents" which is in the same folder as your program:
Documents/myFile.rev
This is a good use of relative paths because it means you can move your program, and as long as the file is moved to the same place, ie relative to your program its still in the same place, you don't need to change any code.
With regards to your file myMov.mov, could you explain exactly where it is located? If you give me the absolute path of the file, and the absolute path of your stack / program I can explain how to use a relative path to access the file.
Hope this is some help.
Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution
Software Developer
Runtime Revolution