CodeIgniter Forums

Full Version: specifying a path in Windows vs Linux
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to write out some data to Amazon's S3 database. As part of this I needed to create a file with my amazon credentials called credentials and place it in a file called "$Homedirectory/aws/.credentials". First, I don't think you can create a file in windows that start with a "." and second, when I try running I get an error Cannot read credentials from 


C:\Users\richb201 is my correct home directory.  But /.aws/credentials was added by the Amazon PHP sdk (I can see that in my debugger). I always thought that in Windows (like in DOS)  the . is the parent directory. Is this path not working because this sdk thinks I am running in Linux? Why are the adding forward slashes? Should I be adding a Linux dual boot to my Windows PC?
You're correct that Windows file manager will complain if you start filename with a dot (like .htaccess), tho filenames starting with dot will work on Windows.

On Linux, files or folders starting with . in the name are hidden by default. Reference . on it's own is reference to "self" or "current folder", and double-dot .. is reference to parent folder, that's same on all OSs.

What's the actual error message?
An uncaught Exception was encountered
Type: Aws\Exception\CredentialsException

Message: Cannot read credentials from C:\Users\richb201/.aws/credentials

Filename: C:\xampp\htdocs\sub_crud\vendor\aws\aws-sdk-php\src\Credentials\CredentialProvider.php

Which is funny because the docs say to use C:\Users\richb201\aws\.credentials

There is another way to specify credentials which is by putting them in environment variables, but in tracing through the code I don't see where that gets used. I did try it.
Because you mentioned it before in the OP - are you sure you have . in folder name (.aws) and no dot in filename (credentials) on your hard drive?
I just realized I can make it from the DOS box, which I did. I got past the error by doing that. Onward to the next error......

If you open command prompt on windows, you can use rename
cd C:\Users\richb201
rename aws .aws
You can save a file in Windows using NotePad you just have to select all file types in the dropdown.
dos box worked fine. Do people still use that term? BTW?