LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-30-2017, 08:27 AM   #1
colweb
LQ Newbie
 
Registered: Oct 2014
Location: planet Earth
Distribution: Slackware
Posts: 21

Rep: Reputation: Disabled
Slackware 14.2 cp cannot stat file


Hi all,

Strange problem. I did install Slackware 14.2 on my laptop and changed default locale to en_US.UFT-8 (same as on my server, running Slackware 14.1).

Mounted a samba share: mount.cifs //server/data /mnt/hd

Then tried to copy a few files but got "cannot stat .... no such file or directory". Very strange as ls -l shows the files.

Did create a file with the same name on the laptop "index.html?key@view=1" and tried to copy it to the server. No problem at all.

Next I installed samba on the laptop and mounted a samba share from the server: mount.cifs //laptop/share /mnt/hd
Now I could copy the file without problem. So it seems that copying under Slack 14.1 gives no problems but with Slack 14.2 some files gives problems.

No idea why and no idea how to solve it.
 
Old 06-30-2017, 08:56 AM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by colweb View Post
Hi all,

Did create a file with the same name on the laptop "index.html?key@view=1" and tried to copy it to the server. No problem at all.
colweb --

That's one ugly filename

Does this work ?

Code:
ls -la /mnt/hd/foo.txt                  # make sure that /mnt/hd/foo.txt does not exist.  If not ...
echo "test" > /mnt/hd/foo.txt           # change foo.txt to 'somethingelse' if foo.txt exists !
cp -a /mnt/hd/foo.txt /tmp/
cat /tmp/foo.txt
If so, at least you can focus on how to represent the 'ugly filenames' so that they work with the new Locale stuff in 14.2 ...

HTH

-- kjh
 
Old 06-30-2017, 09:35 AM   #3
colweb
LQ Newbie
 
Registered: Oct 2014
Location: planet Earth
Distribution: Slackware
Posts: 21

Original Poster
Rep: Reputation: Disabled
Hi kjhambrick,

No problem with that.

The strange thing is, I can copy the file from Slack 14.1 (the server) to Slack 14.2 (the laptop) with ftp.

After mounting the samba shares (on both the laptop and the server - same smb.conf) I can copy the file from the laptop to the server (done on the server) but not from the server to the laptop (done on the laptop). But I can copy it from the server to the laptop when done from the server.

But... the laptop does show the file(s) with ls -al.

When doing a stat index.html\?key@view=1 it gives:
File: 'index.html?key@view=1'
Size: 20599 Blocks: 2048 IO Block: 16384 regular file
Device: 1bh/27d Inode: 414 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2017-06-30 12:02:30.000000000 +0200
Modify: 2013-08-24 14:32:18.000000000 +0200
Change: 2017-06-24 12:15:55.000000000 +0200
Birth: -

Last edited by colweb; 06-30-2017 at 09:46 AM.
 
Old 06-30-2017, 09:50 AM   #4
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
colweb --

I sometimes have to resort to ls -laQ to 'see' all the nasty squiggles and whatnots in Windows FileNames.

Maybe ls -laQ will quote the filename so you can grab it ?

Another thing I've had to do from time-to-time is change LC_ALL for a particular command ...

Code:
LC_ALL=C cp -p '/mnt/hd/index.html?key@view=1' /tmp/
All the possible values of LC_ALL can get icky with Mounted Windows Shares. It has always been hit-n-miss, but I've had best luck with the temporary LC_ALL=C invocation.

Another thing I've done when the Source Directory is not too huge is to stage the files on the linux box using rsync and then dispatch them from the local copy ...( not a great soulution )...

I am sure there is a better way ... something did definitely change on 14.2 but I can't put my finger on it.

Maybe another LQ Expert has a clue ?

-- kjh
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to append file to tar archive returns error “Cannot stat: No such file or dire Simon_zhu Linux - Newbie 3 06-11-2015 11:02 PM
[SOLVED] Using actime in stat.h file to record the time a file was accessed. MichaelStein Linux - Newbie 3 04-23-2014 08:45 PM
[SOLVED] hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS) is referenced by DSO harig Programming 1 03-28-2013 06:34 AM
[SOLVED] gcc linker error - hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS) chaosless Linux - Software 1 09-17-2009 12:33 PM
Can not stat file? cmfarley19 Linux - General 2 08-24-2006 12:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration