How does juce represent drive c?


#1

Hi,
I have a juce::String c:\temp, however, I use this string as argument in other function _chdir(), _chdir() can not recognize the drive c: .
So how to represent drive c in juce string?

Best
Leon


#2

…sorry, that sounds extremely muddled, I’m really not sure what you’re asking?


#3

try toUTF8() method, that worked for me when pasing JUCE strings to curl calls.


#4

Hi, Everyone
I may not state clearly.Please forget about what I posted before.
I describe the scenario.

When I use File::moveFileTo(), I have a original file at

c:\Users\leon\AppData\Local\Temp\Low\Music\track1.wav,
I set this path as juce::String, oldPath

and I have a destination at

c:\Users\leon\Song\song1.wav, and I want to move and rename track1.wav to song1.wav.
I set this path as juce::String , newPath

I use the moveFileTo() method as follows:

juce::File oldFile(oldFile);
juce::File newFile(newPath);
oldFile.moveFileTo(newFile);
This should move to the oldFile to desired location , and rename
it to song1.wav.
However, it moved the oldFile to

C:\Users\leon\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized\C\Users\leon\Song\song1.wav.

I thought the reason is juce does not recognize the C drive, and append it to the default directory.

I asked whether juce need some special process of Drive, not just put it in the string.

Best
leon

distination path and orignial path are right in my code, we use moveFileTo with right args, and this method returns true for success, however, the orginal file is still moved to the default place.


#5

I wrote wrong . juce::File oldFile(oldFile) should be
juce::File oldFile(oldPath);


#6

I’ve been using moveFileTo() happily with no problems for a long time, so very much doubt if it’s a bug. Looks to me like what you’ve done is just to give it a destination string that is “c\users\etc” without the “:”, so you should check that the strings are actually what you expect them to be.