473,729 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change dir owner

This has probably been answered a million times, but I can't seem to
find the answer.

How can I change the owner of a directory using a Perl command? I
know chown can be used with files, but it doesn't appear to work with
directories.

Thanks in advance,
Frank
Jul 19 '05 #1
7 9311
I found that you can issue a system command that works instead, but it
seems like there should be a Perl function that does the same.

system("chown username.groupn ame my_folder");
Jul 19 '05 #2
dw
"Frank McCown" <mc*****@yahoo. com> wrote in message
news:87******** *************** ***@posting.goo gle.com...
I found that you can issue a system command that works instead, but it
seems like there should be a Perl function that does the same.

system("chown username.groupn ame my_folder");


it's in there....
perldoc -f chown
Jul 19 '05 #3
This is a reference to the chown function that changes FILE ownership,
not DIRECTORY ownership. I've tried to use the chown function to
modifiy dir ownership, and it fails.

it's in there....
perldoc -f chown

Jul 19 '05 #4
mc*****@yahoo.c om (Frank McCown) wrote in message news:<87******* *************** ****@posting.go ogle.com>...
This has probably been answered a million times, but I can't seem to
find the answer.
Possibly because the question doesn't exist.
How can I change the owner of a directory using a Perl command? I
know chown can be used with files, but it doesn't appear to work with
directories.


Please produce a minimal but complete set of instuctions to reproduce
the apparance of it not working.

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Jul 19 '05 #5
dw
"Frank McCown" <mc*****@yahoo. com> wrote in message
news:87******** *************** ***@posting.goo gle.com...
This is a reference to the chown function that changes FILE ownership,
not DIRECTORY ownership. I've tried to use the chown function to
modifiy dir ownership, and it fails.

it's in there....
perldoc -f chown


It works for me on both files and directories using 5.8 on both Linux and
cygwin.

Only problem I had on Linux was a permission problem when doing it as
someone other than root... doing
chown $owner, -1, $dir or print "unable to change $dir: $!"
gave me "Operation not permitted" as me, but as root, it worked without a
problem.

What error did it give you?

From cygwin:
$ ll
total 0
drwxrwxrwx+ 2 SYSTEM None 0 Dec 2 23:29 dir/
-rw-rw-rw- 1 SYSTEM None 0 Dec 2 23:29 file1
-rw-rw-rw- 1 David None 0 Dec 2 23:29 file2

$ perl -e 'chown ((stat("file2") )[4], -1, "dir", "file1");'

$ ll
total 0
drwxrwxrwx+ 2 David None 0 Dec 2 23:29 dir/
-rw-rw-rw- 1 David None 0 Dec 2 23:29 file1
-rw-rw-rw- 1 David None 0 Dec 2 23:29 file2


Jul 19 '05 #6
dw-

Your code snippet worked fine on my system. I ran my original code
this morning and I can't reproduce my original error (yet)... very
frustrating.

I really appreciate your time.
nobull-

You are one witty guy. Why don't you tell the guys at Google that
this newsgroup doesn't "exist", and maybe they'll disable their
software to allow posts to it.
Jul 19 '05 #7
In a follow-up to someone else, but clearly supposed to be in response
to my post, mc*****@yahoo.c om (Frank McCown) wrote:
You are one witty guy. Why don't you tell the guys at Google that
this newsgroup doesn't "exist", and maybe they'll disable their
software to allow posts to it.


http://groups.google.com/groups?thre...ing.google.com
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4833
by: Ange T | last post by:
Hi, I have a secured Access 2000 database, and have encountered a strange error that I can't find any similar postings on. I'd really appreciate your help! In my database, I have a number of local tables as well as a number of linked tables. The User that I have logged in as ("Developer1") is the owner of all objects and is Administrator. In the User and Group Permissions box, under Change Owner, Developer1 is the current owner
2
1896
by: Richard Sherratt | last post by:
I create a new user and make them a member of Admins. I then log on as that user and try to modify an existing query. I'm told that I don't have the necessary permissions. The Admins group has full permissions on the query. The new user can create new queries and modify them, but the database owner cannot modify these queries, even though the database owner explicitly had Administer permission on them. A possible related issue is that...
0
2659
by: Amber | last post by:
There are times when you will need to highlight or otherwise modify the contents of a particular DataGrid row-column value based upon the value in the column. In this example we will select the CompanyName, ContactName, and ContactTitle columns from the Customers table in the Northwind database. Whenever the value of ContactTitle equals "Owner" we will change the font color to red. We can do this by using an ItemTemplate where we have...
0
1286
by: mike | last post by:
At this site, they use DB2 8.2.2 on LUW , and have thousands of DARI style stored procedures ('c', embedded-static SQL). During PREP and BIND they specify the package-owner with the OWNER clause, as the fenced-userid. However, the db2-instances each have a distinct fenced-userid. This means that a restored offline-backup taken from a different db2-instance has all the "package-owner" setting incorrect for the new
5
91732
by: papayaya | last post by:
Our programmer has left the company and the tables and views were created with his credential as owner. How do I change the ownership of all the tables and views using the stored procedure - sp_changedbowner? Instead of typing the individual table and view name to change the db owner, is there a way to change the owner at once?
2
1960
by: Denis | last post by:
How can you get the contents of a text box to change after for click out of it. Eg I have a text box on a form called Ownername. If some one enters a name in lower case that it automatically changes it to sentence case ie john smith goes to John Smith Thanks Denis
0
2362
by: =?Utf-8?B?TWFydGluIw==?= | last post by:
Hello everybody! Please note that I have posted same question in different forums with no success. So If you tried to help me there, please do not consider the repost as rude! I'm working on an application which has UserControls (GUI pages) with TabControls on it. This TabControls are Usercontrols derived from Windows.Forms.TabControl. Same to TabPage.
3
4761
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a property based on CollectionBase class. like the following one : //------- XGrid.cs file --------------// public ColumnsCollection Columns {
0
1052
by: andremc | last post by:
Hello everyone, I've looked around, but haven't been able to get an exact answer to this question. I have three user roles which have access to their own folders, and an owner role which can access all. authentication and authorization is set up correctly, since it performs as needed. Is there a way that a person in the "Owner" role can grant permission for a member of one of the other roles to access a particular page that currently only...
3
14412
by: coolminded | last post by:
hi, i have create one database with owner 'postgres' and i created tables with the same owner. but now i want to change the owner of the database as well as the tables. i changed the owner of database but i couldn't change the owner of the tables all at once. my postgres database is in linux server. and it's version is "PostgreSQL 8.1.3 " thanx.
0
8911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8760
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6015
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.