Results 1 to 7 of 7

Thread: cat write error invalid argument

  1. #1
    Join Date
    Dec 2010
    Beans
    29

    cat write error invalid argument

    hi, i am trying to:
    abc@abc-linux:~/Desktop$ cat "sample.au" > /dev/snd/seq

    but it says:cat write error invalid argument

    do you see what the problem is?

  2. #2
    Join Date
    Apr 2011
    Location
    Maryland
    Beans
    1,461
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: cat write error invalid argument

    Do you have write permissions for that file? Try running the command with sudo.

  3. #3
    Join Date
    Dec 2010
    Beans
    29

    Re: cat write error invalid argument

    Quote Originally Posted by drmrgd View Post
    Do you have write permissions for that file? Try running the command with sudo.
    yes i tried it with sudo but same error occured.

  4. #4
    Join Date
    Feb 2008
    Location
    Texas City, Texas
    Beans
    830
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: cat write error invalid argument

    I don't think "cat" is the command you need here. Try using "echo" instead. And use double redirector if you want to add to existing file instead of replacing all information.
    Code:
    abc@abc-linux:~/Desktop$ sudo echo "sample.au" >> /dev/snd/seq
    Break it, fix it, learn something.
    People who never make mistakes seldom make anything!

  5. #5
    Join Date
    Dec 2010
    Beans
    29

    Re: cat write error invalid argument

    Quote Originally Posted by Miljet View Post
    I don't think "cat" is the command you need here. Try using "echo" instead. And use double redirector if you want to add to existing file instead of replacing all information.
    Code:
    abc@abc-linux:~/Desktop$ sudo echo "sample.au" >> /dev/snd/seq
    i tried echo but the error is same:echo: write error: Invalid argument

  6. #6
    Join Date
    Apr 2012
    Beans
    7,256

    Re: cat write error invalid argument

    /dev/snd/seq is a character special file - I think this is more likely why you're getting the error (and why it's 'invalid argument' not 'permission denied')

    What exactly are you trying to do? I don't really know anything about sound but afaik there are some alsa utilities for this kind of thing at a higher level (amidi? aplaymidi?)

    [btw if it was a permissions issue then 'sudo cat' wouldn't help because it's the redirect of stdout that needs elevated write permissions - you could use a 'sudo tee' instead of the '>' or wrap the whole command in a sudo sh 'cat ...' however iirc the default is for /etc/snd/seq to be rw for members of the audio group so provided user is a member of 'audio' there should be no permission issue]

  7. #7
    Join Date
    Dec 2010
    Beans
    29

    Re: cat write error invalid argument

    Quote Originally Posted by steeldriver View Post
    /dev/snd/seq is a character special file - I think this is more likely why you're getting the error (and why it's 'invalid argument' not 'permission denied')

    What exactly are you trying to do? I don't really know anything about sound but afaik there are some alsa utilities for this kind of thing at a higher level (amidi? aplaymidi?)

    [btw if it was a permissions issue then 'sudo cat' wouldn't help because it's the redirect of stdout that needs elevated write permissions - you could use a 'sudo tee' instead of the '>' or wrap the whole command in a sudo sh 'cat ...' however iirc the default is for /etc/snd/seq to be rw for members of the audio group so provided user is a member of 'audio' there should be no permission issue]
    this is an example of accessing devices in a pdf document.it should play the file but it didnt via this codes:
    Code:
    sudo cat  sample.au  >  /dev/snd/seq

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •