Cannot access: No such file or directory | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Cannot access: No such file or directory

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-14-2010
78air 78air is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 17 August 2010, 12:33 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Cannot access: No such file or directory

In a directory I have a file called 250SocatSC. When i use the ls -l command I see its size, permissions, etc. Everything seems alright with it but when I try to copy (cp) it or to rename (mv) it I got the following message: "cannot access: No such file or directory". I suspect that has something to do with its name or the way it was written on the hdd. Other files of the same type (scanned images) are working just fine. I would really want to use this file. It would save me from a lot of work. By the way when I try to make these changes I use the super user account.
Sponsored Links
    #2  
Old 07-14-2010
mikep9 mikep9 is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 14 December 2010, 11:36 AM EST
Location: DFW, TX
Posts: 37
Thanks: 0
Thanked 1 Time in 1 Post
Can you do a ls -l on the directory and post the full line of output for the file? Are you logging in as root or doing a sudo when trying to work with the file?
Sponsored Links
    #3  
Old 07-14-2010
jgt's Avatar
jgt jgt is offline Forum Advisor  
Registered User
 
Join Date: Apr 2007
Last Activity: 20 August 2014, 1:06 PM EDT
Location: 44.21.48N 80.50.15W
Posts: 1,551
Thanks: 1
Thanked 157 Times in 149 Posts
Quite likely the file has a non printing character in its name.
Try

Code:
ls -l >/tmp/list

Then use vi on /tmp/list
    #4  
Old 07-15-2010
78air 78air is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 17 August 2010, 12:33 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I log as root but unfortunately only tomorrow I can show you the exact output of ls -l command.
I'll also try with vi to see if it works and let you know jgt.
Thank you!!!

---------- Post updated 07-15-10 at 09:53 AM ---------- Previous update was 07-14-10 at 12:07 PM ----------

I tried to find out if there were non printing characters in the file name. The output of the command ls -b (ls -q) was:
250SocatSC
forest
mountain
These are the files that I work with (scanned images). For two of them I got the message from the title of this thread even when I try to change their permission with chmod command. The last file is working properly. I can do whatever I like with it.
For mikep9 the output of the command ls -l is:
-rw-r--r-- 18345628 July 14 20:10 250SocatSC
-rw-r--r-- 18345628 July 14 21:00 forest
-rw-r--r-- 18345628 July 14 20:30 mountain

Any other advice?

Last edited by 78air; 07-14-2010 at 04:13 PM..
Sponsored Links
    #5  
Old 07-16-2010
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 672 Times in 642 Posts
Please post the output from:


Code:
ls -lisa | sed -n l

This should show any funny characters and also display the inode number with the links count. The "$" at the end of each line is normal (it's the line-feed character).
Please don't forget to include all the output (including where ls shows the parent directory and the dot files).
Also we'll need to know your username and group in the context of the above directory listing.


Let's see if a program is holding the inode after another program has deleted the file?

Code:
fuser *


Last edited by methyl; 07-16-2010 at 07:59 AM..
Sponsored Links
    #6  
Old 07-17-2010
78air 78air is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 17 August 2010, 12:33 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I'm on holiday for the next couple of weeks so the files MUST wait. Thanks methyl for your answer. I'll try to post the output as soon as possible and let you know. You'll hear from me soon.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Solaris auditing (file access logging) for specific directory only. +Yan UNIX for Advanced & Expert Users 0 02-15-2010 07:56 AM
User with limited access to one directory q8devilish Solaris 7 11-12-2009 06:06 AM
Restricting FTP access for a particular directory Vijayakumarpc Solaris 1 10-14-2009 12:52 PM
How to access an directory with spaces Ariean UNIX for Dummies Questions & Answers 1 01-26-2009 03:45 PM
failed to access directory thru ftp DILEEP410 Shell Programming and Scripting 1 01-09-2007 08:05 AM



All times are GMT -4. The time now is 10:14 AM.