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

(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/.aws/credentials

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
Reply
#2

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?
Reply
#3

(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
Reply
#4

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?
Reply
#5

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


thx
proof that an old dog can learn new tricks
Reply
#6

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

If you open command prompt on windows, you can use rename
Code:
cd C:\Users\richb201
rename aws .aws
Reply
#7

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 )
Reply
#8

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




Theme © iAndrew 2016 - Forum software by © MyBB