Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: pekv2 on September 23, 2011, 10:07:59 PM



Title: [Solved]Bitcoin Client 0.4 & Win7 junction problem.
Post by: pekv2 on September 23, 2011, 10:07:59 PM
Edit:
Solution found here. https://bitcointalk.org/index.php?topic=45483.msg542485#msg542485
End of edit:

I've got a new problem.

I've uninstalled my 0.3.24 beta bitcoin client which had the C:\Users\Admin\AppData\Roaming\Bitcoin junction pointing to D:\Bitcoin

I've installed the newest release Bitcoin Client 0.4. Ran it, got an error

Code:
************************
EXCEPTION: N5boost11filesystem316filesystem_errorE      
boost::filesystem::create_directory: Cannot create a file when that file already exists: "C:\Users\Admin\AppData\Roaming\Bitcoin"      
D:\Program Files (x86)\Bitcoin\bitcoin.exe in AppInit()      



************************
EXCEPTION: N5boost11filesystem316filesystem_errorE      
boost::filesystem::create_directory: Cannot create a file when that file already exists: "C:\Users\Admin\AppData\Roaming\Bitcoin"      
D:\Program Files (x86)\Bitcoin\bitcoin.exe in CMyApp::OnUnhandledException()      

So, I deleted that junction & the destination folder "D:\Bitcoin". Ran bitcoin client, bitcoin client created the "C:\Users\Admin\AppData\Roaming\Bitcoin"  location, then closed bitcoin client.

Tried to create the junction

Code:
C:\Users\Admin>mklink /J C:\Users\Admin\AppData\Roaming\Bitcoin D:\Bitcoin
Cannot create a file when that file already exists.

So bitcoin client and trying to create the junction are fighting each other resulting in, cannot use a junction.

Does anyone have any suggestions? Ran into this problem that found a solution?


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: Bitsky on September 23, 2011, 10:40:01 PM
Does anyone have any suggestions? Ran into this problem that found a solution?
Yes. Use the datadir switch.


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: pekv2 on September 23, 2011, 10:57:52 PM
Does anyone have any suggestions? Ran into this problem that found a solution?
Yes. Use the datadir switch.


Care to explain please?

Thanks.


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: c_k on September 24, 2011, 04:07:37 AM
It is an option, kindly RTFM  ;)


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: c_k on September 24, 2011, 04:15:01 AM
If you do not have an answer, do not post in my thread.

You already have the answer bro!


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: c_k on September 24, 2011, 04:18:57 AM
If you do not have an answer, do not post in my thread.

You already have the answer bro!

And how is that? This is exactly what I did for 0.3.24 beta and had no problem and just did it again for a test with 0.3.24 beta, no errors, no problems.

So if someone has a solution for 0.4 please post it.

The first reply in this thread _is_ the answer :)


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: pekv2 on September 24, 2011, 04:20:22 AM
Hm, mklink /J datadir C:\Users\Admin\AppData\Roaming\Bitcoin D:\Bitcoin does not work.


Title: Re: Bitcoin Client 0.4 & Win7 junction problem.
Post by: c_k on September 24, 2011, 04:22:55 AM
Ok your problem is obvious now, -datadir= is for bitcoin.exe (from https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments )  :)


Title: Re: [Solved]Bitcoin Client 0.4 & Win7 junction problem.
Post by: vv01f on September 24, 2011, 08:15:15 AM
Tried to create the junction
Code:
C:\Users\Admin>mklink /J C:\Users\Admin\AppData\Roaming\Bitcoin D:\Bitcoin
Cannot create a file when that [b]file already exists[/b].
So bitcoin client and trying to create the junction are fighting each other resulting in, cannot use a junction
Its all there to solve your "problem".
simply move all the files to the destination and delete the directory %appdata%\bitcoin
THEN you can create your junction (due to the same name) quite fine - i am doing this all the time when installing at friends

btw: for those not comfortable on commandline: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

the thing with datadir is.. if you accidently run some client (other/newer version etc.) without the switch.. you still can rely on the junction.

*edit: finally it seems i should have read more carefully.. but i would say its not a solution but a workaround to rely on datadir-option.
i estimate this behavior being a bug in new client version  :-\


Title: Re: [Solved]Bitcoin Client 0.4 & Win7 junction problem.
Post by: pekv2 on September 24, 2011, 08:26:01 AM
Tried to create the junction
Code:
C:\Users\Admin>mklink /J C:\Users\Admin\AppData\Roaming\Bitcoin D:\Bitcoin
Cannot create a file when that [b]file already exists[/b].
So bitcoin client and trying to create the junction are fighting each other resulting in, cannot use a junction
Its all there to solve your "problem".
simply move all the files to the destination and delete the directory %appdata%\bitcoin
THEN you can create your junction (due to the same name) quite fine - i am doing this all the time when installing at friends

btw: for those not comfortable on commandline: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html

the thing with datadir is.. if you accidently run some client (other/newer version etc.) without the switch.. you still can rely on the junction.

Did you read my post? After "simply move all the files to the destination and delete the directory %appdata%\bitcoin, THEN you can create your junction" firing up bitcoin client throws this error.

Code:
************************
EXCEPTION: N5boost11filesystem316filesystem_errorE      
boost::filesystem::create_directory: Cannot create a file when that file already exists: "C:\Users\Admin\AppData\Roaming\Bitcoin"      
D:\Program Files (x86)\Bitcoin\bitcoin.exe in AppInit()      



************************
EXCEPTION: N5boost11filesystem316filesystem_errorE      
boost::filesystem::create_directory: Cannot create a file when that file already exists: "C:\Users\Admin\AppData\Roaming\Bitcoin"      
D:\Program Files (x86)\Bitcoin\bitcoin.exe in CMyApp::OnUnhandledException()  

But the datadir cmd is working quite well.