You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a little problem..
I built this code.. the target is change the name of the jpg file in my folder.. I does not work.. I thought it might not be pointing at the folder.. its that way I added the block creating a txt file, the point is that the code create the file, which means is pointing at the folder.. however..the problem is either not pointing at the jpg files or the block code does not work.. I think is not pointing at the files because the downloading files does not increase the counter..
info: the folder has three jpg files, therefore.. the each do should print three times the art into the files.. but it only writes once "asasasasaaasasasaasasasasasasasaa'"
Hi there!
I have a little problem..
I built this code.. the target is change the name of the jpg file in my folder.. I does not work.. I thought it might not be pointing at the folder.. its that way I added the block creating a txt file, the point is that the code create the file, which means is pointing at the folder.. however..the problem is either not pointing at the jpg files or the block code does not work.. I think is not pointing at the files because the downloading files does not increase the counter..
info: the folder has three jpg files, therefore.. the each do should print three times the art into the files.. but it only writes once "asasasasaaasasasaasasasasasasasaa'"
what do you think?
thank you!
Dir.chdir'/Users/sorry/desktop/photos'
pic_names = Dir['Users/sorry/desktop/photos/*/.jpg']
require 'yaml'
test_arr= ['asasasasaaasasasaasasasasasasasaa']
test_arr = test_arr.to_yaml
filename='prueba.txt'
File.open filename, 'w' do |x|
x.write test_arr
end
pic_names.each do |a|
prints 'asdadadada'
end
the block above demostrate its pointing at the folder..
the block bellow
puts 'How would you like to name your photos?'
newname = gets.chomp
puts
print "Downloading #{pic_names.length} photos: "
pic_number = 1
pic_names.each do |x|
print '.'
new_name = if pic_number < 10
"#{name}0 #{pic_number}.jpg"
else
"#{name} #{pic_number}.jpg"
end
File.rename name, newname
pic_number = pic_number + 1
end
The text was updated successfully, but these errors were encountered: