Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] copy files to windows when filenames contain :?\*
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
supermihi
Guru
Guru


Joined: 09 Feb 2005
Posts: 348

PostPosted: Fri Feb 22, 2008 12:32 pm    Post subject: [SOLVED] copy files to windows when filenames contain :?\* Reply with quote

hi,

I am searching for an easy way to copy possibly large amounts of files to a windows filesystem (NTFS or VFAT, possibly Samba-Shares); my problem is that the filenames (music) partly contain characters that are not allowed for windows filesystems, like :?*\.
Is there an _easy_ way, suitable for copying lots of files at once? The workaround I found so far is copying the files temporarily somewhere else on a linux partition and then use e.g. krename to remove the bad characters, but that is quite annoying … doing this directly with konqueror or amarok would be wonderful.
_________________
"You may say I'm a dreamer, but I'm not the only one."


Last edited by supermihi on Fri Feb 22, 2008 2:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
pathfinder
l33t
l33t


Joined: 19 Jan 2006
Posts: 731
Location: Barcelona, Spain

PostPosted: Fri Feb 22, 2008 12:42 pm    Post subject: Reply with quote

well, i would do a tarball
then use p7zip for windows to untar it.
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1127
Location: Austria

PostPosted: Fri Feb 22, 2008 12:42 pm    Post subject: Reply with quote

Put these files in an archive and move the archive to that windows share and unpack the archive and see if the tool can handle the files or (for this you need to emerge rename):
Code:

find music_folder -iname "*" -exec renamexm 's/\:|\*|\?|\"//g' "{}" \;

_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
supermihi
Guru
Guru


Joined: 09 Feb 2005
Posts: 348

PostPosted: Fri Feb 22, 2008 2:49 pm    Post subject: Reply with quote

Thanks for the hint, tarring the files and then unpacking them with 7zip does what I want: It replaces the characters by underbars.
_________________
"You may say I'm a dreamer, but I'm not the only one."
Back to top
View user's profile Send private message
pathfinder
l33t
l33t


Joined: 19 Jan 2006
Posts: 731
Location: Barcelona, Spain

PostPosted: Fri Feb 22, 2008 2:58 pm    Post subject: Reply with quote

and you could also apply sed to the file names:

sed 's/whatyoudontwant/bywhatyouwanttosubstitute/g'

oups. I mean, you should be able to write a script in sed telling the computer to get all files in a directory and replacing their names by another char,

sed 's/_/YEAH/g' input_file > output_file

would create an output file from an input file replacing on all its lines the underscore by the YEAH word.
Back to top
View user's profile Send private message
massimo
Veteran
Veteran


Joined: 22 Jun 2003
Posts: 1127
Location: Austria

PostPosted: Fri Feb 22, 2008 5:52 pm    Post subject: Reply with quote

pathfinder wrote:
and you could also apply sed to the file names:

sed 's/whatyoudontwant/bywhatyouwanttosubstitute/g'

oups. I mean, you should be able to write a script in sed telling the computer to get all files in a directory and replacing their names by another char,

sed 's/_/YEAH/g' input_file > output_file

would create an output file from an input file replacing on all its lines the underscore by the YEAH word.

Well, then take a look at my previous post..... guess what find is doing.
_________________
Hello 911? How are you?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum