Active Forums => QB64 Discussion => Topic started by: Dav on January 18, 2021, 11:01:34 am
Title: Question regarding the "\" in path...
Post by: Dav on January 18, 2021, 11:01:34 am
I am uncertain of the best practice for writing the "\" paths in filenames.
For example, when I have a sub folder, I usually use this, which works for me...
n& = _SNDOPEN("notes\note1.wav")
But I see often this way, with a ".\" added....
n& = _SNDOPEN(".\notes\note1.wav")
Does it differ on OS? Which is the best way
- Dav
Title: Re: Question regarding the "\" in path...
Post by: SMcNeill on January 18, 2021, 11:14:13 am
.\ is simply the current directory, and ..\ is the directory above it.
(Unless you get to remapping drives and directories with symbolic links, and then things can get confusing.)
Generally speaking, it shouldn’t matter a whole lot if you include that .\ in the file path, or not.
Title: Re: Question regarding the "\" in path...
Post by: Dav on January 18, 2021, 11:18:05 am
Thanks, @SMcNeill! I just wanted to be sure - didn't know it linux people needed .\ in there or what.
Also, I was thinking there was a QB64 command to remove the path from a given filename, but I can't find it it in the wiki. Is there one? I was almost certain there was...like doing this...
FUNCTION RemovePath$ (fullpath$) RemovePath$ = MID$(fullPath$, _INSTRREV(fullPath$, "\") + 1) END FUNCTION
Title: Re: Question regarding the "\" in path...
Post by: Dav on January 18, 2021, 11:27:30 am
Perfect! Thanks again, Steve!
- Dav
Title: Re: Question regarding the "\" in path...
Post by: bplus on January 18, 2021, 12:29:09 pm
I find I have to tell QB64 where .ico and library files are with .\ for other files like image or sound, QB64 can find the files in same folder as the .exe without the need for .\ .h files are just assumed to be in same folder as QB64.exe
Title: Re: Question regarding the "\" in path...
Post by: Dav on January 18, 2021, 01:01:53 pm
Thanks, @bplus. I seem to remember now someone else said that to me about something I posted a while back, maybe the drum machine...
Btw, I'm getting ready to post another music app with sound files - but don't worry, I've renamed all the .ogg files to another extension. So hopefully it won't crash for you if you decide to try it out.