Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Permission denied @ sys_fail2 (Err no::EACCES)" if reading id3 from file just before moving the file #61

Open
illtellyoulater opened this issue Aug 7, 2015 · 4 comments

Comments

@illtellyoulater
Copy link

song = "song.mp3"
artist = "artist name"

Mp3Info.open(song) { |mp3info|
  puts mp3info 
  # correctly shows info
}

Dir.mkdir(artist) unless File.exists?(artist)
File.rename("./#{song}", "./#{artist}/#{song}" 
# moving file to a subfolder named according to artist name

Last command outputs:

in `rename': Permission denied @ sys_fail2 (Err no::EACCES)

If I remove the MP3Info block completely everything works and I see no errors.
Same if I use Mp3Info on the file after moving the file to the new folder.

Can it be due to the file still being in use by Mp3Info when trying to move it?

Don't know if it's related to #41

How to fix this?
Thanks

@moumar
Copy link
Owner

moumar commented Aug 10, 2015

hi!
do you know why the File.rename() fails ? I mean, what kind of permission problem is it ?

@illtellyoulater
Copy link
Author

@moumar judging from "Err no::EACCES" I'd say that it has problems acquiring the access to the file.

@moumar
Copy link
Owner

moumar commented Aug 11, 2015

thanks. And what are the file permissions just before the 'rename' ? Are you under windows ?

@illtellyoulater
Copy link
Author

Yes sorry, I'm on Windows 7, 64bit.

ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]

gem query ruby-mp3info
*** LOCAL GEMS ***
ruby-mp3info (0.8.7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants