skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
2.66k stars 185 forks source link

Access to D: drive (secondary drive) denied on windows #139

Open YaserAlOsh opened 2 weeks ago

YaserAlOsh commented 2 weeks ago

Hello,

I am facing an issue with the fortran w64devkit .exe. I am running it on windows 10, and inside the terminal I try to access the d: drive, because that's where my projects are located, but I always get a permission denied error. I have tried running in administrator mode, and running from inside an admin cmd (sh -l). Both methods didn't work.

image

Would appreciate help in solving this. Thanks in advance.

grable0 commented 2 weeks ago

Have you tried cd D:/ ?

skeeto commented 2 weeks ago

The w64devkit shell is busybox-w32 ash, a POSIX shell, which behaves differently than cmd.exe. To change drives, "cd d:" just like you would any other directory change. Changing the current drive isn't a special case operation. When you type "d:" you're (I think) telling the shell to execute the drive like a program. Since you can't execute a drive, it fails with the error translated to a permission error.

YaserAlOsh commented 2 weeks ago

Oh, it worked. Silly mistake. Thanks a lot!


From: Christopher Wellons @.> Sent: Wednesday, June 19, 2024 1:16:54 AM To: skeeto/w64devkit @.> Cc: Yaser @.>; Author @.> Subject: Re: [skeeto/w64devkit] Access to D: drive (secondary drive) denied on windows (Issue #139)

The w64devkit shell is busybox-w32 ash, a POSIX shell, which behaves differently than cmd.exe. To change drives, "cd d:" just like you would any other directory change. Changing the current drive isn't a special case operation. When you type "d:" you're (I think) telling the shell to execute the drive like a program. Since you can't execute a drive, it fails with the error translated to a permission error.

— Reply to this email directly, view it on GitHubhttps://github.com/skeeto/w64devkit/issues/139#issuecomment-2176989939, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGCBNA6MRC364VQIVBWFS6LZICPUNAVCNFSM6AAAAABJQZGCMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWHE4DSOJTHE. You are receiving this because you authored the thread.Message ID: @.***>

rmyorston commented 2 weeks ago

When you type "d:" you're (I think) telling the shell to execute the drive like a program.

Actually, D: refers to the current directory of drive D. If you haven't visited D before it'll be the top-level directory of the drive (D:/). The effect is much the same: you can't execute a directory so the command fails.

Paths of the form D:path (note, no slash after the colon) are relative to the current directory of the drive.

For more about this and how busybox-w32 handles paths see my pathnames webpage.

skeeto commented 2 weeks ago

Thanks for the info, Ron. I didn't know some of this, and it's very helpful!