- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Strange problem with command touch
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 06:37 AM
10-06-2011 06:37 AM
Strange problem with command touch
Hi all,
on HP-UX B.11.11 i can't create an hidden file with command touch:
> touch setup > rm setup > touch .setup touch: cannot change times on .setup
Why i can't create an empty hidden file?
P.S.
In the example above I wanted to show that the "touch" works with a non-hidden file.
Thanks
- Tags:
- Permission
- Touch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 06:49 AM
10-06-2011 06:49 AM
Re: Strange problem with command touch
please send an "ls -la" of .setup.
it might be interesting to do....
- ls -la .setup
- wait one minute
- touch .setup
- ls -la .setup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 06:56 AM
10-06-2011 06:56 AM
Re: Strange problem with command touch
The problem is not that you can't create the file. The problem is that the file already exists and you do not have permissions to modify the file.
I created a file called .test as root and changed the permissions to 600 (rw-------). I then logged in as a non-root user and attempted to 'touch' the file again and got the same error you did.
root@c8kws:/tmp # touch .test root@c8kws:/tmp # ll .test -rw-r--r-- 1 root sys 0 Oct 6 08:50 .test root@c8kws:/tmp # chmod 600 .test root@c8kws:/tmp # su - usera usera@c8kws:/home/usera # cd /tmp usera@c8kws:/tmp # id uid=110(usera) gid=20(users) usera@c8kws:/tmp # ll .test -rw------- 1 root sys 0 Oct 6 08:50 .test usera@c8kws:/tmp # touch .test touch: cannot change times on .test
On your system, do an 'ls -l .setup' to see what the current file looks like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 07:56 AM
10-06-2011 07:56 AM
Re: Strange problem with command touch
@Peval_Stroskan wrote:
on HP-UX B.11.11 i can't create an hidden file with command touch:
> touch setup > rm setup > touch .setup touch: cannot change times on .setupWhy i can't create an empty hidden file?
P.S.
In the example above I wanted to show that the "touch" works with a non-hidden file.
> In the example above I wanted to show thta the "touch" works with a non-hidden file.
But you never tried varying the hidden-name!
The error message "touch: cannot change times on .setup" tells you that '.setup' exists in the first place. If file creation can be done, the permissions exist for 'utime(2) to be able to set the file's timestamps. Otherwise, if the file already exists, but you don't either own the file or have write permissions to it, 'touch' (and the underlying 'utime()' system call) will fail.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 08:44 AM
10-06-2011 08:44 AM
Re: Strange problem with command touch
Thank you all for the answers, but it's my fault. The files .setup already exists but I did not see.
Sorry for the disturbance
Greetings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2011 09:04 AM
10-06-2011 09:04 AM
Re: Strange problem with command touch
@Peval_Stroskan wrote:Thank you all for the answers, but it's my fault. The files .setup already exists but I did not see.
Sorry for the disturbance
Greetings.
You didn't doing any wrong or disturb anyone! My remarks were meant to help you become a better administrator. Standard Unix/Linux commands usually have informative error messages. Sometime reading them for what they are trying to say is enlightening. We all miss the obvious and we all mis-read!
Regards!
...JRF...