Hi,
On one of my Linux machines GetCurrentDir returns '', when the working directory is a samba share.
Is this a feature or a bug?
Mattias

Mailing lists / fpc-pascal / 2013-04
8 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
On one of my Linux machines GetCurrentDir returns '', when the working directory is a samba share.
Is this a feature or a bug?
Mattias
It can happen. The linux kernel returns an empty cwd in some cases. The FPC code tries to work its way up from '.' in such a case.
I just tried, but it gives a correct result in my case.
Michael.
Maybe as fallback it can use the environment variable PWD?
Mattias
In our previous episode, Mattias Gaertner said:
No. That would only be valid right after startup, and doesn't change when you chdir in the program.
+1
Michael.
I think that readlink on /proc/self/cwd should work?
Henry
That is what the kernel getcwd returns.
Sometimes this is empty.
Michael.
I think that readlink on /proc/self/cwd should work? Henry
Could be problematic if the share is in a form that the kernel can't parse.