Skip to content
Extraits de code Groupes Projets
Valider 4db52165 rédigé par Himanshu Chhetri's avatar Himanshu Chhetri
Parcourir les fichiers

Use FileUtils for all file operations. Also uses Kernel.system to execute...

Use FileUtils for all file operations. Also uses Kernel.system to execute shell commands in a secure fashion.
parent 07a54fea
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,12 +17,12 @@ module PhotoMover ...@@ -17,12 +17,12 @@ module PhotoMover
current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}" current_photo_location = "#{Rails.root}/public/uploads/images/#{photo.image_filename}"
new_photo_location = "#{album_dir}/#{photo.image_filename}" new_photo_location = "#{album_dir}/#{photo.image_filename}"
`cp #{current_photo_location} #{new_photo_location}` FileUtils::cp current_photo_location new_photo_location
end end
end end
`tar cf #{user.id}.tar #{user.id}` system("tar", "cf #{user.id}.tar #{user.id}")
`rm -r #{user.id}` FileUtils::rm_r user.id, :secure => true, :force => true
"#{Rails.root}/#{temp_dir}.tar" "#{Rails.root}/#{temp_dir}.tar"
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter