• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
specifying a path in Windows vs Linux

#1
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?
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
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.
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
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
Reply

#6
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 the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#8
dos box worked fine. Do people still use that term? BTW?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.