Add mtime to receiving filename, so that we dont have name clashes with systems that use the same archive name for our host
This commit is contained in:
parent
250e584c03
commit
67747c062a
@ -102,13 +102,13 @@ class File extends FileBase implements \Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the file, without a node ID prefix
|
* Return the name of the file, without a node ID, mtime prefix
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function rawName(): string
|
public function rawName(): string
|
||||||
{
|
{
|
||||||
return preg_replace('/^[0-9A-F]{4}-/','',$this->getFilename());
|
return preg_replace('/^[0-9A-F]{4}-([0-9]+)-]/','',$this->getFilename());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +36,7 @@ final class Item extends Receive
|
|||||||
return Storage::disk(config('fido.local_disk'))->exists($this->rel_name);
|
return Storage::disk(config('fido.local_disk'))->exists($this->rel_name);
|
||||||
|
|
||||||
case 'pref_name':
|
case 'pref_name':
|
||||||
return sprintf('%04X-%s',$this->ao->id,$this->recvas);
|
return sprintf('%04X-%d-%s',$this->ao->id,$this->recvmtime,$this->recvas);
|
||||||
case 'rel_name':
|
case 'rel_name':
|
||||||
return sprintf('%s/%s',config('fido.dir'),$this->pref_name);
|
return sprintf('%s/%s',config('fido.dir'),$this->pref_name);
|
||||||
case 'full_name':
|
case 'full_name':
|
||||||
|
@ -49,7 +49,7 @@ class PacketProcess extends Command
|
|||||||
if ($this->argument('ftn')) {
|
if ($this->argument('ftn')) {
|
||||||
$a = Address::findFTN($this->argument('ftn'));
|
$a = Address::findFTN($this->argument('ftn'));
|
||||||
|
|
||||||
} elseif (preg_match('/^(([0-9]+)-)+/',$this->argument('file'),$m)) {
|
} elseif (preg_match('/^(([0-9A-F]+)-([0-9]+))+/',$this->argument('file'),$m)) {
|
||||||
$a = Address::findOrFail(hexdec($m[2]));
|
$a = Address::findOrFail(hexdec($m[2]));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user