input: from typing import Dict, Union, List
  
  
  class FileSystem(object):
      def __init__(self, param: Dict[str, str]):
          pass
  
      def save_task(self, data: Dict[str, Union[str, int]]) -> None:
          """ Store task data in a file. If 'id' is not in the data dictionary,
          generate a new task ID and add it to the dictionary. The task data is
          stored in a file in a subdirectory of the taskDir directory, named
          after the task ID.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.save_task({'name': 'Task1', 'description': 'First task'})
          """
          pass
  
      def delete_task(self, task_id: int) -> None:
          """ Delete the subdirectory containing the task data for the given task ID.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.delete_task(1)
          """
          pass
  
      def find_by_id(self, task_id: int) -> Dict[str, Union[str, int]]:
          """ Find and return the task data for the given task ID as a dictionary.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.find_by_id(1)
          {'id': 1, 'name': 'Task1', 'description': 'First task'}
          """
          pass
  
      def find_by_ids(self, task_ids: List[int]) -> List[Dict[str, Union[str, int]]]:
          """ Find and return the task data for the given list of task IDs as a
          list of dictionaries.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.find_by_ids([1, 2])
          [{'id': 1, 'name': 'Task1', 'description': 'First task'}, {'id': 2, 'name': 'Task2', 'description': 'Second task'}]
          """
          pass
  
      def all_task_data(self, order: str = 'asc') -> List[Dict[str, Union[str, int]]]:
          """ Return a list of all task data dictionaries, sorted by ID in ascending
          order by default, or descending order if the 'order' parameter is set to 'desc'.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.all_task_data()
          [{'id': 1, 'name': 'Task1', 'description': 'First task'}, {'id': 2, 'name': 'Task2', 'description': 'Second task'}]
          """
          pass
  
      def task_data(self, task_id: int) -> Union[Dict[str, Union[str, int]], None]:
          """ Return the task data for the given task ID as a dictionary, or None
          if the task data is not found.
          
          >>> fs = FileSystem({'taskDir': '~/jsub/'})
          >>> fs.task_data(1)
          {'id': 1, 'name': 'Task1', 'description': 'First task'}
          >>> fs.task_data(3)
          None
          """
          pass
output:     
      def __init__(self, param: Dict[str, str]):
          self.taskDir = param['taskDir']
          self.tasks = {}
  
      def save_task(self, data: Dict[str, Union[str, int]]) -> None:
          if 'id' not in data:
              data['id'] = len(self.tasks) + 1
          self.tasks[data['id']] = data
          with open(f"{self.taskDir}/{data['id']}.txt", 'w') as f:
              f.write(str(data))
  
      def delete_task(self, task_id: int) -> None:
          if task_id in self.tasks:
              del self.tasks[task_id]
              import os
              os.remove(f"{self.taskDir}/{task_id}.txt")
  
      def find_by_id(self, task_id: int) -> Dict[str, Union[str, int]]:
          return self.tasks.get(task_id, {})
  
      def find_by_ids(self, task_ids: List[int]) -> List[Dict[str, Union[str, int]]]:
          return [self.tasks.get(tid, {}) for tid in task_ids]
  
      def all_task_data(self, order: str = 'asc') -> List[Dict[str, Union[str, int]]]:
          sorted_tasks = sorted(self.tasks.values(), key=lambda x: x['id'], reverse=(order == 'desc'))
          return sorted_tasks
  
      def task_data(self, task_id: int) -> Union[Dict[str, Union[str, int]], None]:
          return self.tasks.get(task_id, None)
  