CodeIgniter Forums
specifying a path in Windows vs Linux - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: specifying a path in Windows vs Linux (/showthread.php?tid=71392)



specifying a path in Windows vs Linux - richb201 - 08-09-2018

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?


RE: specifying a path in Windows vs Linux - Pertti - 08-09-2018

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?


RE: specifying a path in Windows vs Linux - richb201 - 08-09-2018

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.


RE: specifying a path in Windows vs Linux - Pertti - 08-09-2018

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?


RE: specifying a path in Windows vs Linux - richb201 - 08-09-2018

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


RE: specifying a path in Windows vs Linux - Pertti - 08-09-2018

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



RE: specifying a path in Windows vs Linux - InsiteFX - 08-09-2018

You can save a file in Windows using NotePad you just have to select all file types in the dropdown.


RE: specifying a path in Windows vs Linux - richb201 - 08-09-2018

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