Jump to content
  • 0

Create Random Any file name


Rizuki

Question

Posted

Hellow pro, master and mister can someone help me how can i create a file with random name

Example i want to create 50 or 100  file with random name using lua  how can i make please help me 

7 answers to this question

Recommended Posts

Posted
math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Posted
2 minutes ago, ItsSC said:

math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Thank master ☺️

Posted
31 minutes ago, ItsSC said:

math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Master... Why file not created when i change to some location and also get error when changing to some location to?..

Posted
14 minutes ago, Rizuki said:

Master... Why file not created when i change to some location and also get error when changing to some location to?..

No idea what you changed.

Posted
1 minute ago, ItsSC said:

No idea what you changed.

math.randomseed(os.time()) 
for i = 1 , 50 do 
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122)) 
io.open("/storage/emulated/0/"..randName,"w"):write("This is mallicious file.") 
end

 

Location only i change

Posted
4 minutes ago, Rizuki said:

math.randomseed(os.time()) 
for i = 1 , 50 do 
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122)) 
io.open("/storage/emulated/0/"..randName,"w"):write("This is mallicious file.") 
end

 

Location only i change

It works fine here. No error at all.

Posted
3 minutes ago, ItsSC said:

It works fine here. No error at all.

Sorry bfo its working but file.created is hide hahaha 😂😂😂 but still thank you master i dont know why is hide when i only use gg to load lua a see it but in my storage is not appearing

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.