is there a way changing ownership of a file after it's created?

One Star

is there a way changing ownership of a file after it's created?

i have a mounted directory (linux) on a windows machine and it's accessible via T:/
so if i create a file, say T:/example.txt, is it possible to change its ownership? i need it to be writable for other external process (i'm using postgres' gpfdist) to populate the file. i cant have that process to create the file and then populate it since i need to manually add headers to the file (limitaion on gpfdist side) and then output from the process will be appended.
in my case, the original user creating the file is talend. but i need to change it to gpfdist. or maybe talend remains but change the permission of the file so that it's writable?
thanks
nuhaa
Moderator

Re: is there a way changing ownership of a file after it's created?

Hi,
i have a mounted directory (linux) on a windows machine and it's accessible via T:/
so if i create a file, say T:/example.txt, is it possible to change its ownership? i need it to be writable for other external process (i'm using postgres' gpfdist) to populate the file. i cant have that process to create the file and then populate it since i need to manually add headers to the file (limitaion on gpfdist side) and then output from the process will be appended.
in my case, the original user creating the file is talend. but i need to change it to gpfdist. or maybe talend remains but change the permission of the file so that it's writable?

Don't understand your requirement very well, window access to Linux(i think window cannot support that) or Linux access to Window? Perhaps, you own system permissions are not set readable and writable?
Need your confirmation!
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: is there a way changing ownership of a file after it's created?

hi sabrina,
thanks lot for that input. well basically i have a shared drive on my windows T:/ that's basically pointing to a folder in a remote linux machine
anyway, i've set the system permission so that gpfdist can write the same file
thanks
nuhaa
Moderator

Re: is there a way changing ownership of a file after it's created?

Hi,
the original user creating the file is talend

What kind of the file? If it is a generated file by talend job, i think it is writable.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
One Star

Re: is there a way changing ownership of a file after it's created?

hello
yea it's writable by talend user, but not others. i have external process (gpfdist) that has its own user trying to write the file that talend just created. this gave me permission error. i wonder if talend can change the permission or owner of the file before the external process executes Smiley Happy
another way is add gpfdist user to the same group as talend user so they have the same permission. this way the permission issue will go away.
nuhaa
Moderator

Re: is there a way changing ownership of a file after it's created?

Hi,
i wonder if talend can change the permission or owner of the file before the external process executes

In Talend, it don't recommend change the permission or owner of the file, because we seldom involved in the permissions issue.
another way is add gpfdist user to the same group as talend user so they have the same permission. this way the permission issue will go away.

I think it is a good resolution for your problem.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.