Welcome Guest, Not a member yet? Register   Sign In
specifying a path in Windows vs Linux

(This post was last modified: 08-09-2018, 05:31 AM by richb201.)

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?
proof that an old dog can learn new tricks

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?

(This post was last modified: 08-09-2018, 06:41 AM by richb201.)

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.
proof that an old dog can learn new tricks

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?

(This post was last modified: 08-09-2018, 07:09 AM by richb201.)

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......

proof that an old dog can learn new tricks

(This post was last modified: 08-09-2018, 07:09 AM by Pertti.)

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

dos box worked fine. Do people still use that term? BTW?
proof that an old dog can learn new tricks

Theme © iAndrew 2016 - Forum software by © MyBB