For following command:
solc --abi -o '/tmp' './spec/fixtures/greeter.sol'
You get following messages:
Exception during output generation: /tmp/solidity-20170201-68591-whagys/solidity_0.4.9/solc/CommandLineInterface.cpp(469): Throw in function void dev::solidity::CommandLineInterface::createFile(const string &, const string &)
Dynamic exception type: boost::exception_detail::clone_impl<dev::FileError>
std::exception::what: FileError
[dev::tag_comment*] = Could not write to file: /tmp/./spec/fixtures/greeter.sol:greeter.abi
The source filename is concatenated with destination folder with source pathname.
So instead of:
./spec/fixtures/greeter.sol:greeter.abi
we got:
/tmp/./spec/fixtures/greeter.sol:greeter.abi
It does work if you use solc --abi -o /tmp spec/fixtures/greeter.sol does it?
Nope, error message is:
Exception during output generation: /tmp/solidity-20170202-25074-udp7o6/solidity_0.4.9/solc/CommandLineInterface.cpp(469): Throw in function void dev::solidity::CommandLineInterface::createFile(const string &, const string &)
Dynamic exception type: boost::exception_detail::clone_impl<dev::FileError>
std::exception::what: FileError
[dev::tag_comment*] = Could not write to file: /tmp/spec/fixtures/greeter.sol:greeter.abi
It does work if I navigate to spec/fixtures and type:
solc --abi -o /tmp greeter.sol
@marekkirejczyk I think you are using MacOS and this is actually the same problem as #1631. For me on Mac #1648 fixes this.
I think fixed by #1648. Please reopen if persists (see nightly tomorrow or the next release).
@axic
Happenned to me today:
PS C:\Users\Alex\source\repos\Solidity24\Solidity24> solc "Example.sol" -o "obj/Debug/" --bin --abi --overwrite
Exception during output generation: C:\projects\solidity\solc\CommandLineInterface.cpp(505): Throw in function void __cdecl dev::solidity::CommandLineInterface::createFile(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)
Dynamic exception type: class boost::exception_detail::clone_impl<struct dev::FileError>
std::exception::what: FileError
[struct dev::tag_comment * __ptr64] = Could not write to file: obj/Debug/greeter.bin
For this file
pragma solidity ^0.4.11;
contract mortal {
/* Define variable owner of the type address */
address owner;
/* This function is executed at initialization and sets the owner of the contract */
function mortal() public {
owner = msg.sender;
}
/* Function to recover the funds on the contract */
function kill() public {
if (msg.sender == owner) {
selfdestruct(owner);
}
}
}
contract greeter is mortal {
/* Define variable greeting of the type string */
string greeting;
/* This runs when the contract is executed */
function greeter(string _greeting) public {
greeting = _greeting;
}
/* Main function */
function greet() public constant returns (string) {
return greeting;
}
}
Version: 0.4.21+commit.dfe3193c.Windows.msvc
@axic
I found out what happens: it fails when path ends with separator. obj/debug works while obj/debug/ doesn't.
Most helpful comment
@axic
I found out what happens: it fails when path ends with separator.
obj/debugworks whileobj/debug/doesn't.