Hello Everyone,

This is my first post as I generally try to never ask for help and am a firm believer of figuring out problems myself as I generally learn a crap ton in the process, but this is one problem that I just can't seem to get past. My C++ knowledge is very limited as I have just started with the language, and I am actually trying to take existing code developed by a previous developer for the client and get it working... So enough rambling onto my problem.

My application is basically a File IO hog that it's sole purpose is to move a file inside one directory and move it into another. The way that I retrieve the resting place for that file is by reading a Data Matrix Barcode which has the folder name encoded within.

Here's kinda the process of how the application is supposed to work.

1) Read the directory /tmp/orders and see if any results come back (in the form of a PDF).
2) Loop over the results and read the barcode that is on the bottom right of the PDF.
3) Check to see if the folder name exists that has been decoded from the PDF.
if(boost::filesystem::exists(/orders/{encoded_folder_name}))
4) Move the file from it's current resting place to inside of that folder.

The problem I am having is that when I decode the barcode, the result I'm getting is an unsigned char*, from there I'm trying to recast that into a string, concatenate it onto the end of a base folder path, and check to see if that folder exists.

Here's my code illustrating that.
std::string baseContainer = "/orders";
std::string tempOrder = "order1";
decItem = dParse.decode((char *) codedItem.str().c_str());

boost::filesystem:ath fullPath = baseContainer + "/" + decItem;

if(boost::filesystem::exists(fullPath)){
std::cout << "Order Folder exists: " << fullPath << std::endl;
} else {
std::cout << "Order Folder doesn't exist: " << fullPath << std::endl;
}

fullPath = baseContainer + "/" + tempOrder;

if(boost::filesystem::exists(fullPath)){
std::cout << "Order Folder exists: " << fullPath << std::endl;
} else {
std::cout << "Order Folder doesn't exist: " << fullPath << std::endl;
}

Now for the decode method all that is doing is the following which at the end of the method I return the result variable.
msg = dmtxDecodeMatrixRegion(dec, reg, DmtxUndefined);
if(msg != NULL) {
std::cout << "\t\t\t\tBarcode Found..." << std::endl;
result = std::string(reinterpret_cast<const char*>(msg->output));
dmtxMessageDestroy(&msg);
}

return result;

Now running that application, no matter what I always get the else statement hit saying the folder doesn't exist on the first boost exists check using the decoded item. However using the statically set tempOrder variable boost says the folder does exist. However they put output the exact same path. I know this has to be something to do with the way that the decoded item is being converted from an unsigned char* to a string and being used for a path but I cannot figure out any other way to form that path and get boost to recognize it as a path. This is probably going to be something really stupid for a lot of you but for me it's killing me and I can't move on until I figure out why this just doesn't work... Any help would be much appreciated.

I'm currently using the following if it helps.
boost-1.38.0
libdmtx-0.7.0 <-- used to read the barcode data
CentOS 5.2

If there is any information you need that I didn't provide I'd be more then glad to provide that if it helps resolve this issue. Thanks again.